; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (2135)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [12 x [12 x i8]], align 16
@_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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %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
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  br label %16

16:                                               ; preds = %194, %0
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr %18, i64 %21
  %23 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %22)
  br i1 %23, label %24, label %195

24:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %25

25:                                               ; preds = %48, %24
  %26 = load i32, ptr %4, align 4, !tbaa !8
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = icmp sle i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 4, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %51

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %31

31:                                               ; preds = %44, %30
  %32 = load i32, ptr %6, align 4, !tbaa !8
  %33 = load i32, ptr %2, align 4, !tbaa !8
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %47

36:                                               ; preds = %31
  %37 = load i32, ptr %4, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %38
  %40 = load i32, ptr %6, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [12 x i8], ptr %39, i64 0, i64 %41
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %42)
  br label %44

44:                                               ; preds = %36
  %45 = load i32, ptr %6, align 4, !tbaa !8
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %6, align 4, !tbaa !8
  br label %31, !llvm.loop !11

47:                                               ; preds = %35
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %4, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %4, align 4, !tbaa !8
  br label %25, !llvm.loop !13

51:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = srem i32 %52, 4
  store i32 %53, ptr %7, align 4, !tbaa !8
  %54 = load i32, ptr %7, align 4, !tbaa !8
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %86

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %57

57:                                               ; preds = %82, %56
  %58 = load i32, ptr %8, align 4, !tbaa !8
  %59 = load i32, ptr %2, align 4, !tbaa !8
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %85

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %63

63:                                               ; preds = %77, %62
  %64 = load i32, ptr %9, align 4, !tbaa !8
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %80

68:                                               ; preds = %63
  %69 = load i32, ptr %8, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %70
  %72 = load i32, ptr %9, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [12 x i8], ptr %71, i64 0, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !14
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %75)
  br label %77

77:                                               ; preds = %68
  %78 = load i32, ptr %9, align 4, !tbaa !8
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %9, align 4, !tbaa !8
  br label %63, !llvm.loop !15

80:                                               ; preds = %67
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %82

82:                                               ; preds = %80
  %83 = load i32, ptr %8, align 4, !tbaa !8
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %8, align 4, !tbaa !8
  br label %57, !llvm.loop !16

85:                                               ; preds = %61
  br label %86

86:                                               ; preds = %85, %51
  %87 = load i32, ptr %7, align 4, !tbaa !8
  %88 = icmp eq i32 %87, 1
  br i1 %88, label %92, label %89

89:                                               ; preds = %86
  %90 = load i32, ptr %7, align 4, !tbaa !8
  %91 = icmp eq i32 %90, -3
  br i1 %91, label %92, label %122

92:                                               ; preds = %89, %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %93

93:                                               ; preds = %118, %92
  %94 = load i32, ptr %10, align 4, !tbaa !8
  %95 = load i32, ptr %2, align 4, !tbaa !8
  %96 = icmp sle i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %121

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %99 = load i32, ptr %2, align 4, !tbaa !8
  store i32 %99, ptr %11, align 4, !tbaa !8
  br label %100

100:                                              ; preds = %113, %98
  %101 = load i32, ptr %11, align 4, !tbaa !8
  %102 = icmp sge i32 %101, 1
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %116

104:                                              ; preds = %100
  %105 = load i32, ptr %11, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %106
  %108 = load i32, ptr %10, align 4, !tbaa !8
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [12 x i8], ptr %107, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !14
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %111)
  br label %113

113:                                              ; preds = %104
  %114 = load i32, ptr %11, align 4, !tbaa !8
  %115 = add nsw i32 %114, -1
  store i32 %115, ptr %11, align 4, !tbaa !8
  br label %100, !llvm.loop !17

116:                                              ; preds = %103
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %118

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

121:                                              ; preds = %97
  br label %122

122:                                              ; preds = %121, %89
  %123 = load i32, ptr %7, align 4, !tbaa !8
  %124 = icmp eq i32 %123, 2
  br i1 %124, label %128, label %125

125:                                              ; preds = %122
  %126 = load i32, ptr %7, align 4, !tbaa !8
  %127 = icmp eq i32 %126, -2
  br i1 %127, label %128, label %158

128:                                              ; preds = %125, %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %129 = load i32, ptr %2, align 4, !tbaa !8
  store i32 %129, ptr %12, align 4, !tbaa !8
  br label %130

130:                                              ; preds = %154, %128
  %131 = load i32, ptr %12, align 4, !tbaa !8
  %132 = icmp sge i32 %131, 1
  br i1 %132, label %134, label %133

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

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %135 = load i32, ptr %2, align 4, !tbaa !8
  store i32 %135, ptr %13, align 4, !tbaa !8
  br label %136

136:                                              ; preds = %149, %134
  %137 = load i32, ptr %13, align 4, !tbaa !8
  %138 = icmp sge i32 %137, 1
  br i1 %138, label %140, label %139

139:                                              ; preds = %136
  store i32 25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %152

140:                                              ; preds = %136
  %141 = load i32, ptr %12, align 4, !tbaa !8
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %142
  %144 = load i32, ptr %13, align 4, !tbaa !8
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [12 x i8], ptr %143, i64 0, i64 %145
  %147 = load i8, ptr %146, align 1, !tbaa !14
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %147)
  br label %149

149:                                              ; preds = %140
  %150 = load i32, ptr %13, align 4, !tbaa !8
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %13, align 4, !tbaa !8
  br label %136, !llvm.loop !19

152:                                              ; preds = %139
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %154

154:                                              ; preds = %152
  %155 = load i32, ptr %12, align 4, !tbaa !8
  %156 = add nsw i32 %155, -1
  store i32 %156, ptr %12, align 4, !tbaa !8
  br label %130, !llvm.loop !20

157:                                              ; preds = %133
  br label %158

158:                                              ; preds = %157, %125
  %159 = load i32, ptr %7, align 4, !tbaa !8
  %160 = icmp eq i32 %159, 3
  br i1 %160, label %164, label %161

161:                                              ; preds = %158
  %162 = load i32, ptr %7, align 4, !tbaa !8
  %163 = icmp eq i32 %162, -1
  br i1 %163, label %164, label %194

164:                                              ; preds = %161, %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %165 = load i32, ptr %2, align 4, !tbaa !8
  store i32 %165, ptr %14, align 4, !tbaa !8
  br label %166

166:                                              ; preds = %190, %164
  %167 = load i32, ptr %14, align 4, !tbaa !8
  %168 = icmp sge i32 %167, 1
  br i1 %168, label %170, label %169

169:                                              ; preds = %166
  store i32 28, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %193

170:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !8
  br label %171

171:                                              ; preds = %185, %170
  %172 = load i32, ptr %15, align 4, !tbaa !8
  %173 = load i32, ptr %2, align 4, !tbaa !8
  %174 = icmp sle i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 31, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %188

176:                                              ; preds = %171
  %177 = load i32, ptr %15, align 4, !tbaa !8
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %178
  %180 = load i32, ptr %14, align 4, !tbaa !8
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [12 x i8], ptr %179, i64 0, i64 %181
  %183 = load i8, ptr %182, align 1, !tbaa !14
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %183)
  br label %185

185:                                              ; preds = %176
  %186 = load i32, ptr %15, align 4, !tbaa !8
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %15, align 4, !tbaa !8
  br label %171, !llvm.loop !21

188:                                              ; preds = %175
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %190

190:                                              ; preds = %188
  %191 = load i32, ptr %14, align 4, !tbaa !8
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr %14, align 4, !tbaa !8
  br label %166, !llvm.loop !22

193:                                              ; preds = %169
  br label %194

194:                                              ; preds = %193, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %16, !llvm.loop !23

195:                                              ; preds = %16
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %196 = load i32, ptr %1, align 4
  ret i32 %196
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [12 x [12 x i8]], align 16
@_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 i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr %4, i64 %7
  %9 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %8)
  br i1 %9, label %.preheader62, label %._crit_edge94

.preheader62:                                     ; preds = %0, %.loopexit
  %10 = load i32, ptr %1, align 4, !tbaa !8
  %.not65 = icmp slt i32 %10, 1
  br i1 %.not65, label %._crit_edge67, label %.preheader60

.preheader60:                                     ; preds = %.preheader62, %._crit_edge
  %11 = phi i32 [ %15, %._crit_edge ], [ %10, %.preheader62 ]
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %._crit_edge ], [ 1, %.preheader62 ]
  %.not5763 = icmp slt i32 %11, 1
  br i1 %.not5763, label %.preheader60.._crit_edge_crit_edge, label %.lr.ph

.preheader60.._crit_edge_crit_edge:               ; preds = %.preheader60
  %.pre = sext i32 %11 to i64
  br label %._crit_edge

._crit_edge67:                                    ; preds = %._crit_edge, %.preheader62
  %12 = phi i32 [ %10, %.preheader62 ], [ %15, %._crit_edge ]
  %13 = load i32, ptr %2, align 4, !tbaa !8
  %14 = srem i32 %13, 4
  switch i32 %14, label %default.unreachable124 [
    i32 0, label %.preheader61
    i32 -3, label %29
    i32 1, label %29
    i32 -2, label %42
    i32 2, label %42
    i32 -1, label %56
    i32 3, label %56
  ]

.preheader61:                                     ; preds = %._crit_edge67
  %.not5372 = icmp slt i32 %12, 1
  br i1 %.not5372, label %.loopexit, label %.preheader59

._crit_edge:                                      ; preds = %.lr.ph, %.preheader60.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader60.._crit_edge_crit_edge ], [ %19, %.lr.ph ]
  %15 = phi i32 [ %11, %.preheader60.._crit_edge_crit_edge ], [ %18, %.lr.ph ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %.not.not = icmp slt i64 %indvars.iv97, %.pre-phi
  br i1 %.not.not, label %.preheader60, label %._crit_edge67, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader60, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader60 ]
  %16 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %indvars.iv97, i64 %indvars.iv
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %1, align 4, !tbaa !8
  %19 = sext i32 %18 to i64
  %.not57.not = icmp slt i64 %indvars.iv, %19
  br i1 %.not57.not, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader59:                                     ; preds = %.preheader61, %._crit_edge71
  %20 = phi i32 [ %22, %._crit_edge71 ], [ %12, %.preheader61 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge71 ], [ 1, %.preheader61 ]
  %.not5668 = icmp slt i32 %20, 1
  br i1 %.not5668, label %._crit_edge71, label %.lr.ph70

._crit_edge71:                                    ; preds = %.lr.ph70, %.preheader59
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %22 = load i32, ptr %1, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  %.not53.not = icmp slt i64 %indvars.iv103, %23
  br i1 %.not53.not, label %.preheader59, label %.loopexit, !llvm.loop !15

.lr.ph70:                                         ; preds = %.preheader59, %.lr.ph70
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.lr.ph70 ], [ 1, %.preheader59 ]
  %24 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %indvars.iv103, i64 %indvars.iv100
  %25 = load i8, ptr %24, align 1, !tbaa !16
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %25)
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %27 = load i32, ptr %1, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %.not56.not = icmp slt i64 %indvars.iv100, %28
  br i1 %.not56.not, label %.lr.ph70, label %._crit_edge71, !llvm.loop !17

29:                                               ; preds = %._crit_edge67, %._crit_edge67
  %.not5478 = icmp slt i32 %12, 1
  br i1 %.not5478, label %._crit_edge80, label %.preheader58

.preheader58:                                     ; preds = %29, %._crit_edge77
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %._crit_edge77 ], [ 1, %29 ]
  %30 = phi i32 [ %34, %._crit_edge77 ], [ %12, %29 ]
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph76, label %._crit_edge77

.lr.ph76:                                         ; preds = %.preheader58
  %32 = zext nneg i32 %30 to i64
  br label %36

._crit_edge77:                                    ; preds = %36, %.preheader58
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %34 = load i32, ptr %1, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %.not54.not = icmp slt i64 %indvars.iv109, %35
  br i1 %.not54.not, label %.preheader58, label %._crit_edge80, !llvm.loop !18

36:                                               ; preds = %.lr.ph76, %36
  %indvars.iv106 = phi i64 [ %32, %.lr.ph76 ], [ %indvars.iv.next107, %36 ]
  %37 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %indvars.iv106, i64 %indvars.iv109
  %38 = load i8, ptr %37, align 1, !tbaa !16
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %38)
  %indvars.iv.next107 = add nsw i64 %indvars.iv106, -1
  %40 = icmp ugt i64 %indvars.iv106, 1
  br i1 %40, label %36, label %._crit_edge77, !llvm.loop !19

._crit_edge80:                                    ; preds = %._crit_edge77, %29
  %41 = phi i32 [ %12, %29 ], [ %34, %._crit_edge77 ]
  switch i32 %14, label %.loopexit [
    i32 -2, label %42
    i32 2, label %42
    i32 -1, label %56
    i32 3, label %56
  ]

42:                                               ; preds = %._crit_edge67, %._crit_edge67, %._crit_edge80, %._crit_edge80
  %43 = phi i32 [ %12, %._crit_edge67 ], [ %12, %._crit_edge67 ], [ %41, %._crit_edge80 ], [ %41, %._crit_edge80 ]
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph87.preheader, label %._crit_edge88

.lr.ph87.preheader:                               ; preds = %42
  %45 = zext nneg i32 %43 to i64
  br label %.lr.ph87

.lr.ph87:                                         ; preds = %.lr.ph87.preheader, %._crit_edge84
  %indvars.iv115 = phi i64 [ %45, %.lr.ph87.preheader ], [ %indvars.iv.next116, %._crit_edge84 ]
  %46 = load i32, ptr %1, align 4, !tbaa !8
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph83, label %._crit_edge84

.lr.ph83:                                         ; preds = %.lr.ph87
  %48 = zext nneg i32 %46 to i64
  br label %51

._crit_edge84:                                    ; preds = %51, %.lr.ph87
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next116 = add nsw i64 %indvars.iv115, -1
  %50 = icmp sgt i64 %indvars.iv115, 1
  br i1 %50, label %.lr.ph87, label %._crit_edge88, !llvm.loop !20

51:                                               ; preds = %.lr.ph83, %51
  %indvars.iv112 = phi i64 [ %48, %.lr.ph83 ], [ %indvars.iv.next113, %51 ]
  %52 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %indvars.iv115, i64 %indvars.iv112
  %53 = load i8, ptr %52, align 1, !tbaa !16
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %53)
  %indvars.iv.next113 = add nsw i64 %indvars.iv112, -1
  %55 = icmp ugt i64 %indvars.iv112, 1
  br i1 %55, label %51, label %._crit_edge84, !llvm.loop !21

._crit_edge88:                                    ; preds = %._crit_edge84, %42
  switch i32 %14, label %.loopexit [
    i32 -1, label %56
    i32 3, label %56
  ]

56:                                               ; preds = %._crit_edge67, %._crit_edge67, %._crit_edge80, %._crit_edge80, %._crit_edge88, %._crit_edge88
  %57 = load i32, ptr %1, align 4, !tbaa !8
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %56
  %59 = zext nneg i32 %57 to i64
  br label %.preheader

.preheaderthread-pre-split:                       ; preds = %._crit_edge92
  %indvars.iv.next122 = add nsw i64 %indvars.iv121, -1
  %.pr = load i32, ptr %1, align 4, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %.preheaderthread-pre-split, %.preheader.preheader
  %60 = phi i32 [ %.pr, %.preheaderthread-pre-split ], [ %57, %.preheader.preheader ]
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %.preheaderthread-pre-split ], [ %59, %.preheader.preheader ]
  %.not5589 = icmp slt i32 %60, 1
  br i1 %.not5589, label %._crit_edge92, label %.lr.ph91

._crit_edge92:                                    ; preds = %.lr.ph91, %.preheader
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %62 = icmp sgt i64 %indvars.iv121, 1
  br i1 %62, label %.preheaderthread-pre-split, label %.loopexit, !llvm.loop !22

.lr.ph91:                                         ; preds = %.preheader, %.lr.ph91
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.lr.ph91 ], [ 1, %.preheader ]
  %63 = getelementptr inbounds [12 x [12 x i8]], ptr @a, i64 0, i64 %indvars.iv118, i64 %indvars.iv121
  %64 = load i8, ptr %63, align 1, !tbaa !16
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %64)
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %66 = load i32, ptr %1, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %.not55.not = icmp slt i64 %indvars.iv118, %67
  br i1 %.not55.not, label %.lr.ph91, label %._crit_edge92, !llvm.loop !23

default.unreachable124:                           ; preds = %._crit_edge67
  unreachable

.loopexit:                                        ; preds = %._crit_edge92, %._crit_edge71, %.preheader61, %56, %._crit_edge80, %._crit_edge88
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = getelementptr i8, ptr %70, i64 -24
  %72 = load i64, ptr %71, align 8
  %73 = getelementptr inbounds i8, ptr %69, i64 %72
  %74 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %73)
  br i1 %74, label %.preheader62, label %._crit_edge94, !llvm.loop !24

._crit_edge94:                                    ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!10, !10, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass