; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 6/1574. Mathematicians and brackets (main)

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

@_Z1sB5cxx11 = 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

; 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
  %4 = alloca [100005 x i32], align 16
  %5 = alloca [100005 x i32], align 16
  %6 = alloca [100005 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 400020, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 400020, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 400020, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %64, %0
  %17 = load i32, ptr %7, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %20 = icmp ult i64 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %67

22:                                               ; preds = %16
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %24)
  %26 = load i8, ptr %25, align 1, !tbaa !9
  %27 = sext i8 %26 to i32
  %28 = icmp eq i32 %27, 40
  br i1 %28, label %29, label %32

29:                                               ; preds = %22
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %35

32:                                               ; preds = %22
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %32, %29
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100005 x i32], ptr %4, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100005 x i32], ptr %5, i64 0, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100005 x i32], ptr %6, i64 0, i64 %46
  store i32 %44, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %50, label %63

50:                                               ; preds = %35
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100005 x i32], ptr %6, i64 0, i64 %52
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100005 x i32], ptr %6, i64 0, i64 %56
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %57)
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100005 x i32], ptr %6, i64 0, i64 %61
  store i32 %59, ptr %62, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %50, %35
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %7, align 4, !tbaa !5
  br label %16, !llvm.loop !10

67:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %68 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %69 = trunc i64 %68 to i32
  %70 = sub nsw i32 %69, 2
  store i32 %70, ptr %8, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %88, %67
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = icmp sge i32 %72, 0
  br i1 %73, label %75, label %74

74:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %91

75:                                               ; preds = %71
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100005 x i32], ptr %5, i64 0, i64 %77
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100005 x i32], ptr %5, i64 0, i64 %81
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %78, ptr noundef nonnull align 4 dereferenceable(4) %82)
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100005 x i32], ptr %5, i64 0, i64 %86
  store i32 %84, ptr %87, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %75
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = add nsw i32 %89, -1
  store i32 %90, ptr %8, align 4, !tbaa !5
  br label %71, !llvm.loop !12

91:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %92 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %92, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %119, %91
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %97 = icmp ult i64 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  store i32 8, ptr %11, align 4
  br label %122

99:                                               ; preds = %93
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %101)
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 40
  br i1 %105, label %106, label %109

106:                                              ; preds = %99
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %2, align 4, !tbaa !5
  br label %112

109:                                              ; preds = %99
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %2, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %109, %106
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = icmp slt i32 %113, 0
  br i1 %114, label %115, label %118

115:                                              ; preds = %112
  store i32 0, ptr %2, align 4, !tbaa !5
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = add nsw i32 %116, -1
  store i32 %117, ptr %3, align 4, !tbaa !5
  store i32 8, ptr %11, align 4
  br label %122

118:                                              ; preds = %112
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %10, align 4, !tbaa !5
  br label %93, !llvm.loop !13

122:                                              ; preds = %115, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %2, align 4, !tbaa !5
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %129

126:                                              ; preds = %123
  %127 = load i32, ptr %3, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %3, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %126, %123
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %184

132:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %180, %132
  %134 = load i32, ptr %12, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %137 = sub i64 %136, 1
  %138 = icmp ult i64 %135, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %133
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %183

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100005 x i32], ptr %5, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %12, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100005 x i32], ptr %4, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = sub nsw i32 %145, %149
  store i32 %150, ptr %13, align 4, !tbaa !5
  %151 = load i32, ptr %13, align 4, !tbaa !5
  %152 = icmp slt i32 %151, 0
  br i1 %152, label %153, label %154

153:                                              ; preds = %140
  store i32 13, ptr %11, align 4
  br label %177

154:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %155 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %156 = sub i64 %155, 1
  %157 = getelementptr inbounds [100005 x i32], ptr %4, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  store i32 %158, ptr %14, align 4, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100005 x i32], ptr %4, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = load i32, ptr %14, align 4, !tbaa !5
  %164 = sub nsw i32 %163, %162
  store i32 %164, ptr %14, align 4, !tbaa !5
  %165 = load i32, ptr %12, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [100005 x i32], ptr %6, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = load i32, ptr %14, align 4, !tbaa !5
  %170 = add nsw i32 %168, %169
  %171 = icmp slt i32 %170, 0
  br i1 %171, label %172, label %173

172:                                              ; preds = %154
  store i32 13, ptr %11, align 4
  br label %176

173:                                              ; preds = %154
  %174 = load i32, ptr %3, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %176

176:                                              ; preds = %173, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %177

177:                                              ; preds = %176, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %178 = load i32, ptr %11, align 4
  switch i32 %178, label %188 [
    i32 0, label %179
    i32 13, label %180
  ]

179:                                              ; preds = %177
  br label %180

180:                                              ; preds = %179, %177
  %181 = load i32, ptr %12, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %12, align 4, !tbaa !5
  br label %133, !llvm.loop !14

183:                                              ; preds = %139
  br label %184

184:                                              ; preds = %183, %129
  %185 = load i32, ptr %3, align 4, !tbaa !5
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %185)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 400020, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 400020, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 400020, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %187 = load i32, ptr %1, align 4
  ret i32 %187

188:                                              ; preds = %177
  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: 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)) #3 align 2

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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

@_Z1sB5cxx11 = 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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [100005 x i32], align 16
  %2 = alloca [100005 x i32], align 16
  %3 = alloca [100005 x i32], align 16
  %4 = 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)
  call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %3) #5
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %.not75 = icmp eq i64 %5, 0
  br i1 %.not75, label %._crit_edge, label %6

6:                                                ; preds = %0
  %7 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %9 = icmp eq i8 %8, 40
  %.1.v.peel = select i1 %9, i32 1, i32 -1
  store i32 %.1.v.peel, ptr %1, align 16, !tbaa !8
  store i32 %.1.v.peel, ptr %2, align 16, !tbaa !8
  store i32 %.1.v.peel, ptr %3, align 16, !tbaa !8
  %10 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %11 = icmp ugt i64 %10, 1
  br i1 %11, label %.lr.ph.peel.next, label %._crit_edge

._crit_edge.loopexit.loopexit:                    ; preds = %.lr.ph.peel.next
  %12 = icmp eq i32 %.1, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %6, %._crit_edge.loopexit.loopexit, %0
  %.0.lcssa = phi i1 [ true, %0 ], [ false, %6 ], [ %12, %._crit_edge.loopexit.loopexit ]
  %13 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %14 = trunc i64 %13 to i32
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %.lr.ph65.preheader, label %.preheader59

.lr.ph65.preheader:                               ; preds = %._crit_edge
  %16 = add i64 %13, 4294967294
  %17 = and i64 %16, 4294967295
  br label %.lr.ph65

.lr.ph.peel.next:                                 ; preds = %6, %.lr.ph.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.peel.next ], [ 1, %6 ]
  %.062 = phi i32 [ %.1, %.lr.ph.peel.next ], [ %.1.v.peel, %6 ]
  %18 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = icmp eq i8 %19, 40
  %.1.v = select i1 %20, i32 1, i32 -1
  %.1 = add nsw i32 %.1.v, %.062
  %21 = getelementptr inbounds [100005 x i32], ptr %1, i64 0, i64 %indvars.iv
  store i32 %.1, ptr %21, align 4, !tbaa !8
  %22 = getelementptr inbounds [100005 x i32], ptr %2, i64 0, i64 %indvars.iv
  store i32 %.1, ptr %22, align 4, !tbaa !8
  %23 = getelementptr inbounds [100005 x i32], ptr %3, i64 0, i64 %indvars.iv
  store i32 %.1, ptr %23, align 4, !tbaa !8
  %24 = add nsw i64 %indvars.iv, -1
  %25 = getelementptr inbounds [100005 x i32], ptr %3, i64 0, i64 %24
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %27 = load i32, ptr %26, align 4, !tbaa !8
  store i32 %27, ptr %23, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %29 = icmp ugt i64 %28, %indvars.iv.next
  br i1 %29, label %.lr.ph.peel.next, label %._crit_edge.loopexit.loopexit, !llvm.loop !10

.preheader59:                                     ; preds = %.lr.ph65, %._crit_edge
  %30 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %.not76 = icmp eq i64 %30, 0
  br i1 %.not76, label %.thread, label %.lr.ph68

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %.lr.ph65
  %indvars.iv82 = phi i64 [ %17, %.lr.ph65.preheader ], [ %indvars.iv.next83, %.lr.ph65 ]
  %31 = getelementptr inbounds [100005 x i32], ptr %2, i64 0, i64 %indvars.iv82
  %32 = add nuw nsw i64 %indvars.iv82, 1
  %33 = getelementptr inbounds [100005 x i32], ptr %2, i64 0, i64 %32
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %35 = load i32, ptr %34, align 4, !tbaa !8
  store i32 %35, ptr %31, align 4, !tbaa !8
  %indvars.iv.next83 = add nsw i64 %indvars.iv82, -1
  %.not = icmp eq i64 %indvars.iv82, 0
  br i1 %.not, label %.preheader59, label %.lr.ph65, !llvm.loop !13

36:                                               ; preds = %.lr.ph68
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %37 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %38 = icmp ugt i64 %37, %indvars.iv.next86
  br i1 %38, label %.lr.ph68, label %._crit_edge69.loopexit, !llvm.loop !14

.lr.ph68:                                         ; preds = %.preheader59, %36
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %36 ], [ 0, %.preheader59 ]
  %.2.fr67 = phi i32 [ %.3, %36 ], [ 0, %.preheader59 ]
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv85)
  %40 = load i8, ptr %39, align 1, !tbaa !5
  %.fr77 = freeze i8 %40
  %41 = icmp eq i8 %.fr77, 40
  %.3.v = select i1 %41, i32 1, i32 -1
  %.3 = add i32 %.3.v, %.2.fr67
  %42 = icmp slt i32 %.3, 0
  br i1 %42, label %.thread, label %36

._crit_edge69.loopexit:                           ; preds = %36
  %43 = icmp eq i32 %.3, 0
  %44 = zext i1 %43 to i32
  br label %.thread

.thread:                                          ; preds = %.lr.ph68, %.preheader59, %._crit_edge69.loopexit
  %45 = phi i32 [ 1, %.preheader59 ], [ %44, %._crit_edge69.loopexit ], [ 0, %.lr.ph68 ]
  br i1 %.0.lcssa, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.thread
  %46 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %.not78 = icmp eq i64 %46, 1
  br i1 %.not78, label %.loopexit, label %.lr.ph73

.lr.ph73:                                         ; preds = %.preheader, %63
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %63 ], [ 0, %.preheader ]
  %.24572 = phi i32 [ %.447, %63 ], [ %45, %.preheader ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %47 = getelementptr inbounds [100005 x i32], ptr %2, i64 0, i64 %indvars.iv.next89
  %48 = load i32, ptr %47, align 4, !tbaa !8
  %49 = getelementptr inbounds [100005 x i32], ptr %1, i64 0, i64 %indvars.iv88
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %63, label %52

52:                                               ; preds = %.lr.ph73
  %53 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %54 = add i64 %53, -1
  %55 = getelementptr inbounds [100005 x i32], ptr %1, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = sub i32 %56, %50
  %58 = getelementptr inbounds [100005 x i32], ptr %3, i64 0, i64 %indvars.iv88
  %59 = load i32, ptr %58, align 4, !tbaa !8
  %60 = add nsw i32 %57, %59
  %61 = icmp sgt i32 %60, -1
  %62 = zext i1 %61 to i32
  %.346 = add nsw i32 %.24572, %62
  br label %63

63:                                               ; preds = %.lr.ph73, %52
  %.447 = phi i32 [ %.346, %52 ], [ %.24572, %.lr.ph73 ]
  %64 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %65 = add i64 %64, -1
  %66 = icmp ugt i64 %65, %indvars.iv.next89
  br i1 %66, label %.lr.ph73, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %63, %.preheader, %.thread
  %.5 = phi i32 [ %45, %.thread ], [ %45, %.preheader ], [ %.447, %63 ]
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.5)
  call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %1) #5
  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 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)) local_unnamed_addr #3 align 2

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

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

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

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

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


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