; LLVM IR from Aryansh-S/USACO :: USACO/2019/Open/Bronze (bucket_brigade)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [10 x [10 x i8]], align 16
  %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
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = load ptr, ptr @stdin, align 8, !tbaa !8
  %22 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %21)
  %23 = load ptr, ptr @stdout, align 8, !tbaa !8
  %24 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 100, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %46, %0
  %26 = load i32, ptr %9, align 4, !tbaa !11
  %27 = icmp slt i32 %26, 10
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %49

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

30:                                               ; preds = %42, %29
  %31 = load i32, ptr %11, align 4, !tbaa !11
  %32 = icmp slt i32 %31, 10
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %45

34:                                               ; preds = %30
  %35 = load i32, ptr %9, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [10 x [10 x i8]], ptr %2, i64 0, i64 %36
  %38 = load i32, ptr %11, align 4, !tbaa !11
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [10 x i8], ptr %37, i64 0, i64 %39
  %41 = 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) %40)
  br label %42

42:                                               ; preds = %34
  %43 = load i32, ptr %11, align 4, !tbaa !11
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %11, align 4, !tbaa !11
  br label %30, !llvm.loop !13

45:                                               ; preds = %33
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %9, align 4, !tbaa !11
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %9, align 4, !tbaa !11
  br label %25, !llvm.loop !15

49:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %103, %49
  %51 = load i32, ptr %12, align 4, !tbaa !11
  %52 = icmp slt i32 %51, 10
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %106

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %55

55:                                               ; preds = %99, %54
  %56 = load i32, ptr %13, align 4, !tbaa !11
  %57 = icmp slt i32 %56, 10
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %102

59:                                               ; preds = %55
  %60 = load i32, ptr %12, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10 x [10 x i8]], ptr %2, i64 0, i64 %61
  %63 = load i32, ptr %13, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [10 x i8], ptr %62, i64 0, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !16
  %67 = sext i8 %66 to i32
  %68 = icmp eq i32 %67, 66
  br i1 %68, label %69, label %72

69:                                               ; preds = %59
  %70 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %70, ptr %3, align 4, !tbaa !11
  %71 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %71, ptr %4, align 4, !tbaa !11
  br label %72

72:                                               ; preds = %69, %59
  %73 = load i32, ptr %12, align 4, !tbaa !11
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10 x [10 x i8]], ptr %2, i64 0, i64 %74
  %76 = load i32, ptr %13, align 4, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10 x i8], ptr %75, i64 0, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !16
  %80 = sext i8 %79 to i32
  %81 = icmp eq i32 %80, 82
  br i1 %81, label %82, label %85

82:                                               ; preds = %72
  %83 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %83, ptr %7, align 4, !tbaa !11
  %84 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %84, ptr %8, align 4, !tbaa !11
  br label %85

85:                                               ; preds = %82, %72
  %86 = load i32, ptr %12, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10 x [10 x i8]], ptr %2, i64 0, i64 %87
  %89 = load i32, ptr %13, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [10 x i8], ptr %88, i64 0, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !16
  %93 = sext i8 %92 to i32
  %94 = icmp eq i32 %93, 76
  br i1 %94, label %95, label %98

95:                                               ; preds = %85
  %96 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %96, ptr %5, align 4, !tbaa !11
  %97 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %97, ptr %6, align 4, !tbaa !11
  br label %98

98:                                               ; preds = %95, %85
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %13, align 4, !tbaa !11
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %13, align 4, !tbaa !11
  br label %55, !llvm.loop !17

102:                                              ; preds = %58
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %12, align 4, !tbaa !11
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !11
  br label %50, !llvm.loop !18

106:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %107 = load i32, ptr %5, align 4, !tbaa !11
  %108 = load i32, ptr %3, align 4, !tbaa !11
  %109 = sub nsw i32 %107, %108
  %110 = call i32 @llvm.abs.i32(i32 %109, i1 true)
  %111 = load i32, ptr %6, align 4, !tbaa !11
  %112 = load i32, ptr %4, align 4, !tbaa !11
  %113 = sub nsw i32 %111, %112
  %114 = call i32 @llvm.abs.i32(i32 %113, i1 true)
  %115 = add nsw i32 %110, %114
  %116 = sub nsw i32 %115, 1
  store i32 %116, ptr %14, align 4, !tbaa !11
  %117 = load i32, ptr %5, align 4, !tbaa !11
  %118 = load i32, ptr %3, align 4, !tbaa !11
  %119 = icmp eq i32 %117, %118
  br i1 %119, label %120, label %144

120:                                              ; preds = %106
  %121 = load i32, ptr %3, align 4, !tbaa !11
  %122 = load i32, ptr %7, align 4, !tbaa !11
  %123 = icmp eq i32 %121, %122
  br i1 %123, label %124, label %144

124:                                              ; preds = %120
  %125 = load i32, ptr %8, align 4, !tbaa !11
  %126 = load i32, ptr %4, align 4, !tbaa !11
  %127 = icmp sgt i32 %125, %126
  br i1 %127, label %128, label %132

128:                                              ; preds = %124
  %129 = load i32, ptr %8, align 4, !tbaa !11
  %130 = load i32, ptr %6, align 4, !tbaa !11
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %140, label %132

132:                                              ; preds = %128, %124
  %133 = load i32, ptr %8, align 4, !tbaa !11
  %134 = load i32, ptr %6, align 4, !tbaa !11
  %135 = icmp sgt i32 %133, %134
  br i1 %135, label %136, label %143

136:                                              ; preds = %132
  %137 = load i32, ptr %8, align 4, !tbaa !11
  %138 = load i32, ptr %4, align 4, !tbaa !11
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %140, label %143

140:                                              ; preds = %136, %128
  %141 = load i32, ptr %14, align 4, !tbaa !11
  %142 = add nsw i32 %141, 2
  store i32 %142, ptr %14, align 4, !tbaa !11
  br label %143

143:                                              ; preds = %140, %136, %132
  br label %144

144:                                              ; preds = %143, %120, %106
  %145 = load i32, ptr %6, align 4, !tbaa !11
  %146 = load i32, ptr %4, align 4, !tbaa !11
  %147 = icmp eq i32 %145, %146
  br i1 %147, label %148, label %172

148:                                              ; preds = %144
  %149 = load i32, ptr %4, align 4, !tbaa !11
  %150 = load i32, ptr %8, align 4, !tbaa !11
  %151 = icmp eq i32 %149, %150
  br i1 %151, label %152, label %172

152:                                              ; preds = %148
  %153 = load i32, ptr %7, align 4, !tbaa !11
  %154 = load i32, ptr %3, align 4, !tbaa !11
  %155 = icmp sgt i32 %153, %154
  br i1 %155, label %156, label %160

156:                                              ; preds = %152
  %157 = load i32, ptr %7, align 4, !tbaa !11
  %158 = load i32, ptr %5, align 4, !tbaa !11
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %168, label %160

160:                                              ; preds = %156, %152
  %161 = load i32, ptr %7, align 4, !tbaa !11
  %162 = load i32, ptr %5, align 4, !tbaa !11
  %163 = icmp sgt i32 %161, %162
  br i1 %163, label %164, label %171

164:                                              ; preds = %160
  %165 = load i32, ptr %7, align 4, !tbaa !11
  %166 = load i32, ptr %3, align 4, !tbaa !11
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %168, label %171

168:                                              ; preds = %164, %156
  %169 = load i32, ptr %14, align 4, !tbaa !11
  %170 = add nsw i32 %169, 2
  store i32 %170, ptr %14, align 4, !tbaa !11
  br label %171

171:                                              ; preds = %168, %164, %160
  br label %172

172:                                              ; preds = %171, %148, %144
  %173 = load i32, ptr %14, align 4, !tbaa !11
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %173)
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %174, ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 100, ptr %2) #6
  %176 = load i32, ptr %1, align 4
  ret i32 %176
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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

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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!10, !10, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [10 x [10 x i8]], align 16
  %2 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = load ptr, ptr @stdin, align 8, !tbaa !8
  %9 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %8)
  %10 = load ptr, ptr @stdout, align 8, !tbaa !8
  %11 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %1) #6
  br label %.preheader82

.preheader82:                                     ; preds = %0, %.preheader82
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %.preheader82 ]
  %12 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 0
  %13 = 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) %12)
  %14 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 1
  %15 = 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) %14)
  %16 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 2
  %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)
  %18 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 3
  %19 = 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) %18)
  %20 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 4
  %21 = 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) %20)
  %22 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 5
  %23 = 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) %22)
  %24 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 6
  %25 = 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) %24)
  %26 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 7
  %27 = 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) %26)
  %28 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 8
  %29 = 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) %28)
  %30 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv, i64 9
  %31 = 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) %30)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 10
  br i1 %exitcond.not, label %.preheader, label %.preheader82, !llvm.loop !11

.preheader:                                       ; preds = %.preheader82, %.preheader
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.preheader ], [ 0, %.preheader82 ]
  %.05897 = phi i32 [ %.2.9, %.preheader ], [ undef, %.preheader82 ]
  %.06096 = phi i32 [ %.262.9, %.preheader ], [ undef, %.preheader82 ]
  %.06395 = phi i32 [ %.265.9, %.preheader ], [ undef, %.preheader82 ]
  %.06694 = phi i32 [ %.268.9, %.preheader ], [ undef, %.preheader82 ]
  %.06993 = phi i32 [ %spec.select75.9, %.preheader ], [ undef, %.preheader82 ]
  %.07292 = phi i32 [ %spec.select.9, %.preheader ], [ undef, %.preheader82 ]
  %32 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 0
  %33 = load i8, ptr %32, align 2, !tbaa !13
  %34 = icmp eq i8 %33, 66
  %35 = trunc nuw nsw i64 %indvars.iv105 to i32
  %spec.select75 = select i1 %34, i32 0, i32 %.06993
  %36 = icmp eq i8 %33, 82
  %.2 = select i1 %36, i32 0, i32 %.05897
  %37 = icmp eq i8 %33, 76
  %.265 = select i1 %37, i32 0, i32 %.06395
  %38 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 1
  %39 = load i8, ptr %38, align 1, !tbaa !13
  %40 = icmp eq i8 %39, 66
  %spec.select75.1 = select i1 %40, i32 1, i32 %spec.select75
  %41 = icmp eq i8 %39, 82
  %.2.1 = select i1 %41, i32 1, i32 %.2
  %42 = icmp eq i8 %39, 76
  %.265.1 = select i1 %42, i32 1, i32 %.265
  %43 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 2
  %44 = load i8, ptr %43, align 2, !tbaa !13
  %45 = icmp eq i8 %44, 66
  %spec.select75.2 = select i1 %45, i32 2, i32 %spec.select75.1
  %46 = icmp eq i8 %44, 82
  %.2.2 = select i1 %46, i32 2, i32 %.2.1
  %47 = icmp eq i8 %44, 76
  %.265.2 = select i1 %47, i32 2, i32 %.265.1
  %48 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 3
  %49 = load i8, ptr %48, align 1, !tbaa !13
  %50 = icmp eq i8 %49, 66
  %spec.select75.3 = select i1 %50, i32 3, i32 %spec.select75.2
  %51 = icmp eq i8 %49, 82
  %.2.3 = select i1 %51, i32 3, i32 %.2.2
  %52 = icmp eq i8 %49, 76
  %.265.3 = select i1 %52, i32 3, i32 %.265.2
  %53 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 4
  %54 = load i8, ptr %53, align 2, !tbaa !13
  %55 = icmp eq i8 %54, 66
  %spec.select75.4 = select i1 %55, i32 4, i32 %spec.select75.3
  %56 = icmp eq i8 %54, 82
  %.2.4 = select i1 %56, i32 4, i32 %.2.3
  %57 = icmp eq i8 %54, 76
  %.265.4 = select i1 %57, i32 4, i32 %.265.3
  %58 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 5
  %59 = load i8, ptr %58, align 1, !tbaa !13
  %60 = icmp eq i8 %59, 66
  %spec.select75.5 = select i1 %60, i32 5, i32 %spec.select75.4
  %61 = icmp eq i8 %59, 82
  %.2.5 = select i1 %61, i32 5, i32 %.2.4
  %62 = icmp eq i8 %59, 76
  %.265.5 = select i1 %62, i32 5, i32 %.265.4
  %63 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 6
  %64 = load i8, ptr %63, align 2, !tbaa !13
  %65 = icmp eq i8 %64, 66
  %spec.select75.6 = select i1 %65, i32 6, i32 %spec.select75.5
  %66 = icmp eq i8 %64, 82
  %.2.6 = select i1 %66, i32 6, i32 %.2.5
  %67 = icmp eq i8 %64, 76
  %.265.6 = select i1 %67, i32 6, i32 %.265.5
  %68 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 7
  %69 = load i8, ptr %68, align 1, !tbaa !13
  %70 = icmp eq i8 %69, 66
  %spec.select75.7 = select i1 %70, i32 7, i32 %spec.select75.6
  %71 = icmp eq i8 %69, 82
  %.2.7 = select i1 %71, i32 7, i32 %.2.6
  %72 = icmp eq i8 %69, 76
  %.265.7 = select i1 %72, i32 7, i32 %.265.6
  %73 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 8
  %74 = load i8, ptr %73, align 2, !tbaa !13
  %75 = icmp eq i8 %74, 66
  %spec.select75.8 = select i1 %75, i32 8, i32 %spec.select75.7
  %76 = icmp eq i8 %74, 82
  %.2.8 = select i1 %76, i32 8, i32 %.2.7
  %77 = icmp eq i8 %74, 76
  %.265.8 = select i1 %77, i32 8, i32 %.265.7
  %78 = getelementptr inbounds [10 x [10 x i8]], ptr %1, i64 0, i64 %indvars.iv105, i64 9
  %79 = load i8, ptr %78, align 1, !tbaa !13
  %80 = icmp eq i8 %79, 66
  %81 = select i1 %80, i1 true, i1 %75
  %82 = select i1 %81, i1 true, i1 %70
  %83 = select i1 %82, i1 true, i1 %65
  %84 = select i1 %83, i1 true, i1 %60
  %85 = select i1 %84, i1 true, i1 %55
  %86 = select i1 %85, i1 true, i1 %50
  %87 = select i1 %86, i1 true, i1 %45
  %88 = select i1 %87, i1 true, i1 %40
  %89 = select i1 %88, i1 true, i1 %34
  %spec.select.9 = select i1 %89, i32 %35, i32 %.07292
  %spec.select75.9 = select i1 %80, i32 9, i32 %spec.select75.8
  %90 = icmp eq i8 %79, 82
  %91 = select i1 %90, i1 true, i1 %76
  %92 = select i1 %91, i1 true, i1 %71
  %93 = select i1 %92, i1 true, i1 %66
  %94 = select i1 %93, i1 true, i1 %61
  %95 = select i1 %94, i1 true, i1 %56
  %96 = select i1 %95, i1 true, i1 %51
  %97 = select i1 %96, i1 true, i1 %46
  %98 = select i1 %97, i1 true, i1 %41
  %99 = select i1 %98, i1 true, i1 %36
  %.262.9 = select i1 %99, i32 %35, i32 %.06096
  %.2.9 = select i1 %90, i32 9, i32 %.2.8
  %100 = icmp eq i8 %79, 76
  %101 = select i1 %100, i1 true, i1 %77
  %102 = select i1 %101, i1 true, i1 %72
  %103 = select i1 %102, i1 true, i1 %67
  %104 = select i1 %103, i1 true, i1 %62
  %105 = select i1 %104, i1 true, i1 %57
  %106 = select i1 %105, i1 true, i1 %52
  %107 = select i1 %106, i1 true, i1 %47
  %108 = select i1 %107, i1 true, i1 %42
  %109 = select i1 %108, i1 true, i1 %37
  %.268.9 = select i1 %109, i32 %35, i32 %.06694
  %.265.9 = select i1 %100, i32 9, i32 %.265.8
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next106, 10
  br i1 %exitcond108.not, label %110, label %.preheader, !llvm.loop !14

110:                                              ; preds = %.preheader
  %111 = sub nsw i32 %.268.9, %spec.select.9
  %112 = call i32 @llvm.abs.i32(i32 %111, i1 true)
  %113 = sub nsw i32 %.265.9, %spec.select75.9
  %114 = call i32 @llvm.abs.i32(i32 %113, i1 true)
  %115 = add nuw nsw i32 %114, %112
  %116 = add nsw i32 %115, -1
  %117 = icmp eq i32 %.268.9, %spec.select.9
  %118 = icmp eq i32 %spec.select.9, %.262.9
  %or.cond = select i1 %117, i1 %118, i1 false
  br i1 %or.cond, label %119, label %127

119:                                              ; preds = %110
  %120 = icmp sgt i32 %.2.9, %spec.select75.9
  %121 = icmp slt i32 %.2.9, %.265.9
  %or.cond76 = select i1 %120, i1 %121, i1 false
  br i1 %or.cond76, label %125, label %122

122:                                              ; preds = %119
  %123 = icmp sgt i32 %.2.9, %.265.9
  %124 = icmp slt i32 %.2.9, %spec.select75.9
  %or.cond77 = select i1 %123, i1 %124, i1 false
  br i1 %or.cond77, label %125, label %127

125:                                              ; preds = %122, %119
  %126 = add nuw nsw i32 %115, 1
  br label %127

127:                                              ; preds = %122, %125, %110
  %.0 = phi i32 [ %126, %125 ], [ %116, %122 ], [ %116, %110 ]
  %128 = icmp eq i32 %.265.9, %spec.select75.9
  %129 = icmp eq i32 %spec.select75.9, %.2.9
  %or.cond78 = select i1 %128, i1 %129, i1 false
  br i1 %or.cond78, label %130, label %138

130:                                              ; preds = %127
  %131 = icmp sgt i32 %.262.9, %spec.select.9
  %132 = icmp slt i32 %.262.9, %.268.9
  %or.cond79 = select i1 %131, i1 %132, i1 false
  br i1 %or.cond79, label %136, label %133

133:                                              ; preds = %130
  %134 = icmp sgt i32 %.262.9, %.268.9
  %135 = icmp slt i32 %.262.9, %spec.select.9
  %or.cond80 = select i1 %134, i1 %135, i1 false
  br i1 %or.cond80, label %136, label %138

136:                                              ; preds = %133, %130
  %137 = add nsw i32 %.0, 2
  br label %138

138:                                              ; preds = %133, %136, %127
  %.1 = phi i32 [ %137, %136 ], [ %.0, %133 ], [ %.0, %127 ]
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.1)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef nonnull @.str.4)
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %1) #6
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) 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) #3

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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

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


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