; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/1115_codefes2015_relay (G)

; 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 [10010 x i32], align 16
@B = external dso_local global [10010 x i32], align 16
@C = external dso_local global [10010 x i32], align 16
@D = external dso_local global [10010 x i32], align 16
@sat = external dso_local global [10010 x i32], 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) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %16 = 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)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %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) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %33, %0
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %36

24:                                               ; preds = %19
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [10010 x i32], ptr @A, i64 0, i64 %26
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [10010 x i32], ptr @B, i64 0, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %31)
  br label %33

33:                                               ; preds = %24
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %5, align 4, !tbaa !5
  br label %19, !llvm.loop !9

36:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %51, %36
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %54

42:                                               ; preds = %37
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [10010 x i32], ptr @C, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [10010 x i32], ptr @D, i64 0, i64 %48
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %49)
  br label %51

51:                                               ; preds = %42
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %6, align 4, !tbaa !5
  br label %37, !llvm.loop !11

54:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 -1, ptr %7, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @sat, ptr noundef getelementptr inbounds (i32, ptr @sat, i64 10010), ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  store i32 0, ptr @sat, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %114, %54
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %117

60:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %61 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %61, ptr %10, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %110, %60
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = icmp sge i32 %63, 0
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %113

66:                                               ; preds = %62
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = icmp sge i32 %70, 0
  br i1 %71, label %72, label %109

72:                                               ; preds = %66
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10010 x i32], ptr @C, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %73, %77
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = icmp sle i32 %78, %79
  br i1 %80, label %81, label %109

81:                                               ; preds = %72
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10010 x i32], ptr @C, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %82, %86
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [10010 x i32], ptr @D, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %93, %97
  store i32 %98, ptr %11, align 4, !tbaa !5
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %89, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [10010 x i32], ptr @C, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %101, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %107
  store i32 %100, ptr %108, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %109

109:                                              ; preds = %81, %72, %66
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %10, align 4, !tbaa !5
  br label %62, !llvm.loop !12

113:                                              ; preds = %65
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %8, align 4, !tbaa !5
  br label %55, !llvm.loop !13

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

118:                                              ; preds = %137, %117
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %140

123:                                              ; preds = %118
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %126
  %128 = load i32, ptr %12, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %129
  %131 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %127, ptr noundef nonnull align 4 dereferenceable(4) %130)
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %135
  store i32 %132, ptr %136, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %123
  %138 = load i32, ptr %12, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %12, align 4, !tbaa !5
  br label %118, !llvm.loop !14

140:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %172, %140
  %142 = load i32, ptr %14, align 4, !tbaa !5
  %143 = load i32, ptr %2, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %175

146:                                              ; preds = %141
  %147 = load i32, ptr %4, align 4, !tbaa !5
  %148 = load i32, ptr %14, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [10010 x i32], ptr @A, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sub nsw i32 %147, %151
  %153 = icmp sge i32 %152, 0
  br i1 %153, label %154, label %171

154:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %155 = load i32, ptr %14, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [10010 x i32], ptr @B, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = load i32, ptr %4, align 4, !tbaa !5
  %160 = load i32, ptr %14, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [10010 x i32], ptr @A, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = sub nsw i32 %159, %163
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 %158, %167
  store i32 %168, ptr %15, align 4, !tbaa !5
  %169 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %170 = load i32, ptr %169, align 4, !tbaa !5
  store i32 %170, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %171

171:                                              ; preds = %154, %146
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %14, align 4, !tbaa !5
  br label %141, !llvm.loop !15

175:                                              ; preds = %145
  %176 = load i32, ptr %13, align 4, !tbaa !5
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %176)
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %177, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #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 4, ptr %2) #6
  %179 = load i32, ptr %1, align 4
  ret i32 %179
}

; 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: 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 dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

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

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


; 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 [10010 x i32], align 16
@B = external dso_local global [10010 x i32], align 16
@C = external dso_local global [10010 x i32], align 16
@D = external dso_local global [10010 x i32], align 16
@sat = external dso_local global [10010 x i32], 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
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %8 = 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)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %.preheader39

.preheader39:                                     ; preds = %.lr.ph, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph42, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %15 = getelementptr inbounds [10010 x i32], ptr @A, i64 0, i64 %indvars.iv
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %17 = getelementptr inbounds [10010 x i32], ptr @B, i64 0, i64 %indvars.iv
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next, %20
  br i1 %21, label %.lr.ph, label %.preheader39, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph42, %.preheader39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @sat, ptr noundef nonnull getelementptr inbounds (i8, ptr @sat, i64 40040), ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr @sat, align 16, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  %.pre75 = load i32, ptr %3, align 4, !tbaa !5
  br i1 %23, label %.lr.ph49, label %.preheader

.lr.ph49:                                         ; preds = %._crit_edge
  %24 = icmp sgt i32 %.pre75, -1
  br i1 %24, label %.lr.ph49.split, label %._crit_edge52

.lr.ph42:                                         ; preds = %.preheader39, %.lr.ph42
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph42 ], [ 0, %.preheader39 ]
  %25 = getelementptr inbounds [10010 x i32], ptr @C, i64 0, i64 %indvars.iv59
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %27 = getelementptr inbounds [10010 x i32], ptr @D, i64 0, i64 %indvars.iv59
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next60, %30
  br i1 %31, label %.lr.ph42, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge46, %._crit_edge
  %32 = phi i32 [ %.pre75, %._crit_edge ], [ %.pr, %._crit_edge46 ]
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph51, label %._crit_edge52

.lr.ph49.split:                                   ; preds = %.lr.ph49, %._crit_edge46
  %34 = phi i32 [ %.pr, %._crit_edge46 ], [ %.pre75, %.lr.ph49 ]
  %35 = phi i32 [ %40, %._crit_edge46 ], [ %22, %.lr.ph49 ]
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge46 ], [ 0, %.lr.ph49 ]
  %36 = icmp sgt i32 %34, -1
  br i1 %36, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %.lr.ph49.split
  %37 = getelementptr inbounds [10010 x i32], ptr @C, i64 0, i64 %indvars.iv65
  %38 = getelementptr inbounds [10010 x i32], ptr @D, i64 0, i64 %indvars.iv65
  %39 = zext nneg i32 %34 to i64
  br label %43

._crit_edge46.loopexit:                           ; preds = %63
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge46.loopexit, %.lr.ph49.split
  %40 = phi i32 [ %.pre, %._crit_edge46.loopexit ], [ %35, %.lr.ph49.split ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next66, %41
  %.pr = load i32, ptr %3, align 4, !tbaa !5
  br i1 %42, label %.lr.ph49.split, label %.preheader, !llvm.loop !12

43:                                               ; preds = %.lr.ph45, %63
  %indvars.iv62 = phi i64 [ %39, %.lr.ph45 ], [ %indvars.iv.next63, %63 ]
  %44 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %indvars.iv62
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, -1
  br i1 %46, label %47, label %63

47:                                               ; preds = %43
  %48 = load i32, ptr %37, align 4, !tbaa !5
  %49 = trunc nuw nsw i64 %indvars.iv62 to i32
  %50 = add nsw i32 %48, %49
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %.not38 = icmp sgt i32 %50, %51
  br i1 %.not38, label %63, label %52

52:                                               ; preds = %47
  %53 = sext i32 %50 to i64
  %54 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %53
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %55 = load i32, ptr %38, align 4, !tbaa !5
  %56 = add nsw i32 %55, %45
  store i32 %56, ptr %5, align 4, !tbaa !5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %54, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %37, align 4, !tbaa !5
  %60 = add nsw i32 %59, %49
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %61
  store i32 %58, ptr %62, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %63

63:                                               ; preds = %43, %47, %52
  %indvars.iv.next63 = add nsw i64 %indvars.iv62, -1
  %64 = icmp sgt i64 %indvars.iv62, 0
  br i1 %64, label %43, label %._crit_edge46.loopexit, !llvm.loop !14

._crit_edge52:                                    ; preds = %.lr.ph51, %.lr.ph49, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %65 = load i32, ptr %1, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph55, label %._crit_edge56

.lr.ph51:                                         ; preds = %.preheader, %.lr.ph51
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %.lr.ph51 ], [ 0, %.preheader ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %67 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %indvars.iv.next69
  %68 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %indvars.iv68
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %67, ptr noundef nonnull align 4 dereferenceable(4) %68)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %67, align 4, !tbaa !5
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next69, %72
  br i1 %73, label %.lr.ph51, label %._crit_edge52, !llvm.loop !15

._crit_edge56:                                    ; preds = %92, %._crit_edge52
  %74 = phi i32 [ 0, %._crit_edge52 ], [ %93, %92 ]
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %74)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph55:                                         ; preds = %._crit_edge52, %92
  %77 = phi i32 [ %93, %92 ], [ 0, %._crit_edge52 ]
  %78 = phi i32 [ %94, %92 ], [ %65, %._crit_edge52 ]
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %92 ], [ 0, %._crit_edge52 ]
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = getelementptr inbounds [10010 x i32], ptr @A, i64 0, i64 %indvars.iv71
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %.not = icmp slt i32 %79, %81
  br i1 %.not, label %92, label %82

82:                                               ; preds = %.lr.ph55
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %83 = getelementptr inbounds [10010 x i32], ptr @B, i64 0, i64 %indvars.iv71
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sub nsw i32 %79, %81
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [10010 x i32], ptr @sat, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, %84
  store i32 %89, ptr %7, align 4, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %91 = load i32, ptr %90, align 4, !tbaa !5
  store i32 %91, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %.pre76 = load i32, ptr %1, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %.lr.ph55, %82
  %93 = phi i32 [ %77, %.lr.ph55 ], [ %91, %82 ]
  %94 = phi i32 [ %78, %.lr.ph55 ], [ %.pre76, %82 ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next72, %95
  br i1 %96, label %.lr.ph55, label %._crit_edge56, !llvm.loop !16
}

; 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 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 dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

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

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


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