; LLVM IR from bqi343/cp-notebook :: Contests/USACO Training/Ch 3/3.3 range (main)

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

%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }

@cin = external dso_local global %"class.std::basic_ifstream", align 8
@cout = external dso_local global %"class.std::basic_ofstream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = 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 [250 x [250 x i8]], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 62500, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %41, %0
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %44

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

19:                                               ; preds = %37, %18
  %20 = load i32, ptr %6, 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
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %40

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 1 dereferenceable(1) %7)
  %26 = load i8, ptr %7, align 1, !tbaa !9
  %27 = sext i8 %26 to i32
  %28 = sub nsw i32 %27, 48
  %29 = icmp ne i32 %28, 0
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [250 x [250 x i8]], ptr %3, i64 0, i64 %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [250 x i8], ptr %32, i64 0, i64 %34
  %36 = zext i1 %29 to i8
  store i8 %36, ptr %35, align 1, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  br label %37

37:                                               ; preds = %24
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %6, align 4, !tbaa !5
  br label %19, !llvm.loop !12

40:                                               ; preds = %23
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !5
  br label %13, !llvm.loop !14

44:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 2, ptr %8, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %153, %44
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %45
  store i32 8, ptr %5, align 4
  br label %156

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %136, %51
  %53 = load i32, ptr %10, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = sub nsw i32 %54, %55
  %57 = add nsw i32 %56, 1
  %58 = icmp slt i32 %53, %57
  br i1 %58, label %60, label %59

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

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

61:                                               ; preds = %132, %60
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = sub nsw i32 %63, %64
  %66 = add nsw i32 %65, 1
  %67 = icmp slt i32 %62, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %61
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %135

69:                                               ; preds = %61
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [250 x [250 x i8]], ptr %3, i64 0, i64 %71
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [250 x i8], ptr %72, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !10, !range !15, !noundef !16
  %77 = trunc i8 %76 to i1
  %78 = zext i1 %77 to i32
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [250 x [250 x i8]], ptr %3, i64 0, i64 %80
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [250 x i8], ptr %81, i64 0, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !10, !range !15, !noundef !16
  %87 = trunc i8 %86 to i1
  %88 = zext i1 %87 to i32
  %89 = and i32 %78, %88
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [250 x [250 x i8]], ptr %3, i64 0, i64 %92
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [250 x i8], ptr %93, i64 0, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !10, !range !15, !noundef !16
  %98 = trunc i8 %97 to i1
  %99 = zext i1 %98 to i32
  %100 = and i32 %89, %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [250 x [250 x i8]], ptr %3, i64 0, i64 %103
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [250 x i8], ptr %104, i64 0, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !10, !range !15, !noundef !16
  %110 = trunc i8 %109 to i1
  %111 = zext i1 %110 to i32
  %112 = and i32 %100, %111
  %113 = icmp ne i32 %112, 0
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [250 x [250 x i8]], ptr %3, i64 0, i64 %115
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [250 x i8], ptr %116, i64 0, i64 %118
  %120 = zext i1 %113 to i8
  store i8 %120, ptr %119, align 1, !tbaa !10
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [250 x [250 x i8]], ptr %3, i64 0, i64 %122
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [250 x i8], ptr %123, i64 0, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !10, !range !15, !noundef !16
  %128 = trunc i8 %127 to i1
  %129 = zext i1 %128 to i32
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = add nsw i32 %130, %129
  store i32 %131, ptr %9, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %69
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %11, align 4, !tbaa !5
  br label %61, !llvm.loop !17

135:                                              ; preds = %68
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %10, align 4, !tbaa !5
  br label %52, !llvm.loop !18

139:                                              ; preds = %59
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %139
  store i32 8, ptr %5, align 4
  br label %150

143:                                              ; preds = %139
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %144)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef @.str.4)
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %146, i32 noundef %147)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef @.str.5)
  store i32 0, ptr %5, align 4
  br label %150

150:                                              ; preds = %143, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %151 = load i32, ptr %5, align 4
  switch i32 %151, label %156 [
    i32 0, label %152
  ]

152:                                              ; preds = %150
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %8, align 4, !tbaa !5
  br label %45, !llvm.loop !19

156:                                              ; preds = %150, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %157

157:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 62500, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %158 = load i32, ptr %1, align 4
  ret i32 %158
}

; 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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #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 = { 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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


; 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_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }

@cin = external dso_local global %"class.std::basic_ifstream", align 8
@cout = external dso_local global %"class.std::basic_ofstream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = 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 i32, align 4
  %2 = alloca [250 x [250 x i8]], align 16
  %3 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 62500, ptr nonnull %2) #5
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.preheader43, label %.critedge

.preheader43:                                     ; preds = %0, %._crit_edge
  %7 = phi i32 [ %9, %._crit_edge ], [ %5, %0 ]
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %._crit_edge ], [ 0, %0 ]
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.preheader43.._crit_edge_crit_edge

.preheader43.._crit_edge_crit_edge:               ; preds = %.preheader43
  %.pre76 = sext i32 %7 to i64
  br label %._crit_edge

.preheader42:                                     ; preds = %._crit_edge
  %.not56 = icmp slt i32 %9, 2
  br i1 %.not56, label %.critedge, label %.preheader41

._crit_edge:                                      ; preds = %.lr.ph, %.preheader43.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre76, %.preheader43.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %9 = phi i32 [ %7, %.preheader43.._crit_edge_crit_edge ], [ %16, %.lr.ph ]
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %10 = icmp slt i64 %indvars.iv.next62, %.pre-phi
  br i1 %10, label %.preheader43, label %.preheader42, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader43, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader43 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %12 = load i8, ptr %3, align 1, !tbaa !12
  %13 = icmp ne i8 %12, 48
  %14 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv61, i64 %indvars.iv
  %15 = zext i1 %13 to i8
  store i8 %15, ptr %14, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !15

.preheader41:                                     ; preds = %.preheader42, %57
  %indvars.iv67 = phi i32 [ %indvars.iv.next68, %57 ], [ -1, %.preheader42 ]
  %19 = phi i32 [ %63, %57 ], [ %9, %.preheader42 ]
  %.03457 = phi i32 [ %62, %57 ], [ 2, %.preheader42 ]
  %.not3851 = icmp slt i32 %19, %.03457
  br i1 %.not3851, label %.critedge, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader41
  %20 = add i32 %19, %indvars.iv67
  %wide.trip.count72 = zext i32 %20 to i64
  %min.iters.check = icmp ult i32 %20, 8
  %n.vec = and i64 %wide.trip.count72, 4294967288
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count72
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge50
  %indvars.iv69 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next70, %._crit_edge50 ]
  %.03352 = phi i32 [ 0, %.preheader.preheader ], [ %.lcssa, %._crit_edge50 ]
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %.phi.trans.insert = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv69, i64 0
  %.pre = load i8, ptr %.phi.trans.insert, align 2, !tbaa !13, !range !16
  %.phi.trans.insert74 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv.next70, i64 0
  %.pre75 = load i8, ptr %.phi.trans.insert74, align 2, !tbaa !13, !range !16
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader
  %.ph = phi i8 [ %.pre75, %.preheader ], [ %vector.recur.extract, %middle.block ]
  %.ph94 = phi i8 [ %.pre, %.preheader ], [ %vector.recur.extract92, %middle.block ]
  %indvars.iv64.ph = phi i64 [ 0, %.preheader ], [ %n.vec, %middle.block ]
  %.147.ph = phi i32 [ %.03352, %.preheader ], [ %44, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader
  %vector.recur.init = insertelement <4 x i8> poison, i8 %.pre75, i64 3
  %vector.recur.init86 = insertelement <4 x i8> poison, i8 %.pre, i64 3
  %21 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.03352, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load91, %vector.body ]
  %vector.recur87 = phi <4 x i8> [ %vector.recur.init86, %vector.ph ], [ %wide.load89, %vector.body ]
  %vec.phi = phi <4 x i32> [ %21, %vector.ph ], [ %41, %vector.body ]
  %vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %42, %vector.body ]
  %22 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv69, i64 %index
  %23 = or disjoint i64 %index, 1
  %24 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv69, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %wide.load = load <4 x i8>, ptr %24, align 1, !tbaa !13
  %wide.load89 = load <4 x i8>, ptr %25, align 1, !tbaa !13
  %26 = shufflevector <4 x i8> %vector.recur87, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %27 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load89, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %28 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv.next70, i64 %23
  %29 = getelementptr inbounds i8, ptr %28, i64 4
  %wide.load90 = load <4 x i8>, ptr %28, align 1, !tbaa !13
  %wide.load91 = load <4 x i8>, ptr %29, align 1, !tbaa !13
  %30 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load90, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %31 = shufflevector <4 x i8> %wide.load90, <4 x i8> %wide.load91, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %32 = and <4 x i8> %26, %30
  %33 = and <4 x i8> %27, %31
  %34 = and <4 x i8> %32, %wide.load
  %35 = and <4 x i8> %33, %wide.load89
  %36 = and <4 x i8> %34, %wide.load90
  %37 = and <4 x i8> %35, %wide.load91
  %38 = getelementptr inbounds i8, ptr %22, i64 4
  store <4 x i8> %36, ptr %22, align 2, !tbaa !13
  store <4 x i8> %37, ptr %38, align 2, !tbaa !13
  %39 = zext <4 x i8> %36 to <4 x i32>
  %40 = zext <4 x i8> %37 to <4 x i32>
  %41 = add <4 x i32> %vec.phi, %39
  %42 = add <4 x i32> %vec.phi88, %40
  %index.next = add nuw i64 %index, 8
  %43 = icmp eq i64 %index.next, %n.vec
  br i1 %43, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %42, %41
  %44 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %vector.recur.extract = extractelement <4 x i8> %wide.load91, i64 3
  %vector.recur.extract92 = extractelement <4 x i8> %wide.load89, i64 3
  br i1 %cmp.n, label %._crit_edge50, label %scalar.ph.preheader

._crit_edge54.split:                              ; preds = %._crit_edge50
  %.not39 = icmp eq i32 %.lcssa, 0
  br i1 %.not39, label %.critedge, label %57

._crit_edge50:                                    ; preds = %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %44, %middle.block ], [ %56, %scalar.ph ]
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %._crit_edge54.split, label %.preheader, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %45 = phi i8 [ %53, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %46 = phi i8 [ %49, %scalar.ph ], [ %.ph94, %scalar.ph.preheader ]
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %scalar.ph ], [ %indvars.iv64.ph, %scalar.ph.preheader ]
  %.147 = phi i32 [ %56, %scalar.ph ], [ %.147.ph, %scalar.ph.preheader ]
  %47 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv69, i64 %indvars.iv64
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %48 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv69, i64 %indvars.iv.next65
  %49 = load i8, ptr %48, align 1, !tbaa !13, !range !16, !noundef !21
  %50 = and i8 %46, %45
  %51 = and i8 %50, %49
  %52 = getelementptr inbounds [250 x [250 x i8]], ptr %2, i64 0, i64 %indvars.iv.next70, i64 %indvars.iv.next65
  %53 = load i8, ptr %52, align 1, !tbaa !13, !range !16, !noundef !21
  %54 = and i8 %51, %53
  store i8 %54, ptr %47, align 1, !tbaa !13
  %55 = zext nneg i8 %54 to i32
  %56 = add nsw i32 %.147, %55
  %exitcond.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count72
  br i1 %exitcond.not, label %._crit_edge50, label %scalar.ph, !llvm.loop !22

57:                                               ; preds = %._crit_edge54.split
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %.03457)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str.4)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %59, i32 noundef %.lcssa)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @.str.5)
  %62 = add nuw nsw i32 %.03457, 1
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03457, %63
  %indvars.iv.next68 = add nsw i32 %indvars.iv67, -1
  br i1 %.not.not, label %.preheader41, label %.critedge, !llvm.loop !23

.critedge:                                        ; preds = %.preheader41, %57, %._crit_edge54.split, %0, %.preheader42
  call void @llvm.lifetime.end.p0(i64 62500, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = !{i8 0, i8 2}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10}
!21 = !{}
!22 = distinct !{!22, !10, !19, !18}
!23 = distinct !{!23, !10}


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