; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/CodeCraft 2015/Problem J (J)

; 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_ostream" = type { ptr, %"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 }

@t = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@b = external dso_local global [100100 x i32], align 16
@c = external dso_local global [100100 x i32], align 16
@cnt = external dso_local global [100100 x i64], align 16
@ans = external dso_local global i64, align 8
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@z = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = 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 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
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %10

10:                                               ; preds = %153, %0
  %11 = load i32, ptr @t, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr @t, align 4, !tbaa !5
  %13 = icmp ne i32 %11, 0
  br i1 %13, label %14, label %157

14:                                               ; preds = %10
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @x)
  call void @llvm.memset.p0.i64(ptr align 16 @cnt, i8 0, i64 800800, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %26, %14
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @x, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %29

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %23
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %24)
  br label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

29:                                               ; preds = %20
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @y)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %41, %29
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr @y, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %44

36:                                               ; preds = %31
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100100 x i32], ptr @b, i64 0, i64 %38
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %39)
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !11

44:                                               ; preds = %35
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @z)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %56, %44
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = load i32, ptr @z, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %59

51:                                               ; preds = %46
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100100 x i32], ptr @c, i64 0, i64 %53
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %54)
  br label %56

56:                                               ; preds = %51
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %4, align 4, !tbaa !5
  br label %46, !llvm.loop !12

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

60:                                               ; preds = %109, %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = load i32, ptr @y, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %60
  br label %66

66:                                               ; preds = %86, %65
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %70, label %84

70:                                               ; preds = %66
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr @x, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %84

74:                                               ; preds = %70
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100100 x i32], ptr @b, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp sle i32 %78, %82
  br label %84

84:                                               ; preds = %74, %70, %66
  %85 = phi i1 [ false, %70 ], [ false, %66 ], [ %83, %74 ]
  br i1 %85, label %86, label %89

86:                                               ; preds = %84
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !5
  br label %66, !llvm.loop !13

89:                                               ; preds = %84
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %92, label %101

92:                                               ; preds = %89
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100100 x i64], ptr @cnt, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !14
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100100 x i64], ptr @cnt, i64 0, i64 %99
  store i64 %97, ptr %100, align 8, !tbaa !14
  br label %101

101:                                              ; preds = %92, %89
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100100 x i64], ptr @cnt, i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !14
  %108 = add nsw i64 %107, %103
  store i64 %108, ptr %106, align 8, !tbaa !14
  br label %109

109:                                              ; preds = %101
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %5, align 4, !tbaa !5
  br label %60, !llvm.loop !16

112:                                              ; preds = %64
  store i64 0, ptr @ans, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %150, %112
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = load i32, ptr @z, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %153

118:                                              ; preds = %113
  br label %119

119:                                              ; preds = %139, %118
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = icmp sle i32 %120, %121
  br i1 %122, label %123, label %137

123:                                              ; preds = %119
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = load i32, ptr @y, align 4, !tbaa !5
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %127, label %137

127:                                              ; preds = %123
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100100 x i32], ptr @b, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100100 x i32], ptr @c, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = icmp sle i32 %131, %135
  br label %137

137:                                              ; preds = %127, %123, %119
  %138 = phi i1 [ false, %123 ], [ false, %119 ], [ %136, %127 ]
  br i1 %138, label %139, label %142

139:                                              ; preds = %137
  %140 = load i32, ptr %8, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %8, align 4, !tbaa !5
  br label %119, !llvm.loop !17

142:                                              ; preds = %137
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = sub nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100100 x i64], ptr @cnt, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !14
  %148 = load i64, ptr @ans, align 8, !tbaa !14
  %149 = add nsw i64 %148, %147
  store i64 %149, ptr @ans, align 8, !tbaa !14
  br label %150

150:                                              ; preds = %142
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %7, align 4, !tbaa !5
  br label %113, !llvm.loop !18

153:                                              ; preds = %117
  %154 = load i64, ptr @ans, align 8, !tbaa !14
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %154)
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef @.str.1)
  br label %10, !llvm.loop !19

157:                                              ; preds = %10
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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_ostream" = type { ptr, %"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 }

@t = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@b = external dso_local global [100100 x i32], align 16
@c = external dso_local global [100100 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [100100 x i64], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@z = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not81 = icmp eq i32 %2, 0
  br i1 %.not81, label %._crit_edge84, label %.lr.ph83

.lr.ph83:                                         ; preds = %0, %53
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800800) @cnt, i8 0, i64 800800, i1 false)
  %5 = load i32, ptr @x, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph83
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @y)
  %8 = load i32, ptr @y, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph54, label %._crit_edge55

.lr.ph:                                           ; preds = %.lr.ph83, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph83 ]
  %10 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @x, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = icmp slt i64 %indvars.iv.next, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge55:                                    ; preds = %.lr.ph54, %._crit_edge
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @z)
  %16 = load i32, ptr @z, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph58, label %.preheader49

.lr.ph54:                                         ; preds = %._crit_edge, %.lr.ph54
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph54 ], [ 0, %._crit_edge ]
  %18 = getelementptr inbounds [100100 x i32], ptr @b, i64 0, i64 %indvars.iv88
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %18)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %20 = load i32, ptr @y, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next89, %21
  br i1 %22, label %.lr.ph54, label %._crit_edge55, !llvm.loop !11

.preheader49:                                     ; preds = %.lr.ph58, %._crit_edge55
  %.lcssa = phi i32 [ %16, %._crit_edge55 ], [ %29, %.lr.ph58 ]
  %23 = load i32, ptr @y, align 4
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.preheader48.lr.ph, label %._crit_edge68

.preheader48.lr.ph:                               ; preds = %.preheader49
  %25 = load i32, ptr @x, align 4
  %26 = sext i32 %25 to i64
  %wide.trip.count = zext nneg i32 %23 to i64
  br label %.preheader48

.lr.ph58:                                         ; preds = %._crit_edge55, %.lr.ph58
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.lr.ph58 ], [ 0, %._crit_edge55 ]
  %27 = getelementptr inbounds [100100 x i32], ptr @c, i64 0, i64 %indvars.iv91
  %28 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %27)
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %29 = load i32, ptr @z, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next92, %30
  br i1 %31, label %.lr.ph58, label %.preheader49, !llvm.loop !12

.preheader48:                                     ; preds = %.preheader48.lr.ph, %.critedge
  %indvars.iv97 = phi i64 [ 0, %.preheader48.lr.ph ], [ %indvars.iv.next98, %.critedge ]
  %.03467 = phi i32 [ 0, %.preheader48.lr.ph ], [ %.135.lcssa, %.critedge ]
  %32 = sext i32 %.03467 to i64
  %.not4259 = icmp sge i64 %indvars.iv97, %32
  %33 = icmp slt i32 %.03467, %25
  %or.cond60 = select i1 %.not4259, i1 %33, i1 false
  br i1 %or.cond60, label %.lr.ph62, label %.critedge

.lr.ph62:                                         ; preds = %.preheader48
  %34 = getelementptr inbounds [100100 x i32], ptr @b, i64 0, i64 %indvars.iv97
  %35 = load i32, ptr %34, align 4, !tbaa !5
  br label %38

._crit_edge68:                                    ; preds = %.critedge, %.preheader49
  store i64 0, ptr @ans, align 8, !tbaa !13
  %36 = icmp sgt i32 %.lcssa, 0
  br i1 %36, label %.preheader.preheader, label %53

.preheader.preheader:                             ; preds = %._crit_edge68
  %37 = sext i32 %23 to i64
  %wide.trip.count109 = zext nneg i32 %.lcssa to i64
  br label %.preheader

38:                                               ; preds = %.lr.ph62, %41
  %indvars.iv94 = phi i64 [ %32, %.lr.ph62 ], [ %indvars.iv.next95, %41 ]
  %39 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv94
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not43 = icmp sgt i32 %40, %35
  br i1 %.not43, label %.critedge.loopexit, label %41

41:                                               ; preds = %38
  %indvars.iv.next95 = add nsw i64 %indvars.iv94, 1
  %.not42 = icmp slt i64 %indvars.iv94, %indvars.iv97
  %42 = icmp slt i64 %indvars.iv.next95, %26
  %or.cond = select i1 %.not42, i1 %42, i1 false
  br i1 %or.cond, label %38, label %.critedge.loopexit, !llvm.loop !15

.critedge.loopexit:                               ; preds = %41, %38
  %.135.lcssa.ph.in = phi i64 [ %indvars.iv94, %38 ], [ %indvars.iv.next95, %41 ]
  %.135.lcssa.ph = trunc i64 %.135.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader48
  %.135.lcssa = phi i32 [ %.03467, %.preheader48 ], [ %.135.lcssa.ph, %.critedge.loopexit ]
  %.not44 = icmp eq i64 %indvars.iv97, 0
  %43 = add nsw i64 %indvars.iv97, -1
  %44 = getelementptr inbounds [100100 x i64], ptr @cnt, i64 0, i64 %43
  %cnt.sink = select i1 %.not44, ptr @cnt, ptr %44
  %.pre = load i64, ptr %cnt.sink, align 8, !tbaa !13
  %45 = sext i32 %.135.lcssa to i64
  %46 = getelementptr inbounds [100100 x i64], ptr @cnt, i64 0, i64 %indvars.iv97
  %47 = add nsw i64 %.pre, %45
  store i64 %47, ptr %46, align 8, !tbaa !13
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge68, label %.preheader48, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.preheader, %.critedge2
  %indvars.iv105 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next106, %.critedge2 ]
  %.078 = phi i32 [ 0, %.preheader.preheader ], [ %.1.lcssa, %.critedge2 ]
  %48 = phi i64 [ 0, %.preheader.preheader ], [ %68, %.critedge2 ]
  %49 = sext i32 %.078 to i64
  %.not4070 = icmp sge i64 %indvars.iv105, %49
  %50 = icmp slt i32 %.078, %23
  %or.cond4771 = and i1 %.not4070, %50
  br i1 %or.cond4771, label %.lr.ph73, label %.critedge2

.lr.ph73:                                         ; preds = %.preheader
  %51 = getelementptr inbounds [100100 x i32], ptr @c, i64 0, i64 %indvars.iv105
  %52 = load i32, ptr %51, align 4, !tbaa !5
  br label %59

._crit_edge79:                                    ; preds = %.critedge2
  store i64 %68, ptr @ans, align 8, !tbaa !13
  br label %53

53:                                               ; preds = %._crit_edge79, %._crit_edge68
  %54 = phi i64 [ %68, %._crit_edge79 ], [ 0, %._crit_edge68 ]
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %54)
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @.str.1)
  %57 = load i32, ptr @t, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !17

59:                                               ; preds = %.lr.ph73, %62
  %indvars.iv101 = phi i64 [ %49, %.lr.ph73 ], [ %indvars.iv.next102, %62 ]
  %60 = getelementptr inbounds [100100 x i32], ptr @b, i64 0, i64 %indvars.iv101
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %.not41 = icmp sgt i32 %61, %52
  br i1 %.not41, label %.critedge2.loopexit, label %62

62:                                               ; preds = %59
  %indvars.iv.next102 = add nsw i64 %indvars.iv101, 1
  %.not40 = icmp slt i64 %indvars.iv101, %indvars.iv105
  %63 = icmp slt i64 %indvars.iv.next102, %37
  %or.cond47 = and i1 %.not40, %63
  br i1 %or.cond47, label %59, label %.critedge2.loopexit, !llvm.loop !18

.critedge2.loopexit:                              ; preds = %62, %59
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv101, %59 ], [ %indvars.iv.next102, %62 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.preheader
  %.1.lcssa = phi i32 [ %.078, %.preheader ], [ %.1.lcssa.ph, %.critedge2.loopexit ]
  %64 = add nsw i32 %.1.lcssa, -1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100100 x i64], ptr @cnt, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !13
  %68 = add nsw i64 %48, %67
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count109
  br i1 %exitcond110.not, label %._crit_edge79, label %.preheader, !llvm.loop !19

._crit_edge84:                                    ; preds = %53, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

!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 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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