; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/DEVGOSTR/A.ll (Z3genii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@ids = external dso_local global [4 x [51 x %"class.std::vector"]], align 16
@p = external dso_local global [50 x [50 x i8]], align 16
@k = external dso_local global [50 x i32], align 16
@ans = external dso_local global [50 x i32], align 16
@q = external dso_local global [50 x i8], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3genii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [4 x [51 x %"class.std::vector"]], ptr @ids, i64 0, i64 %16
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [51 x %"class.std::vector"], ptr %17, i64 0, i64 %19
  store ptr %20, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #4
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  br label %27

27:                                               ; preds = %75, %2
  %28 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %28, label %30, label %29

29:                                               ; preds = %27
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %77

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  store ptr %31, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %56, %30
  %33 = load i32, ptr %11, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %59

37:                                               ; preds = %32
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50 x [50 x i8]], ptr @p, i64 0, i64 %40
  %42 = load i32, ptr %11, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [50 x i8], ptr %41, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = sext i8 %45 to i32
  %47 = load i32, ptr %11, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = icmp ne i32 %46, %51
  %53 = zext i1 %52 to i32
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = add nsw i32 %54, %53
  store i32 %55, ptr %10, align 4, !tbaa !5
  br label %56

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

59:                                               ; preds = %36
  %60 = load i32, ptr %10, align 4, !tbaa !5
  %61 = load ptr, ptr %9, align 8, !tbaa !9
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [50 x i32], ptr @k, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp sle i32 %60, %65
  br i1 %66, label %67, label %74

67:                                               ; preds = %59
  %68 = load ptr, ptr %9, align 8, !tbaa !9
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [50 x i32], ptr @ans, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %71, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %67, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %75

75:                                               ; preds = %74
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br label %27

77:                                               ; preds = %29
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = icmp eq i32 %78, 26
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  br label %149

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

82:                                               ; preds = %146, %81
  %83 = load i32, ptr %12, align 4, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %149

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  store i8 1, ptr %13, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 1
  store i32 %89, ptr %14, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %128, %87
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = icmp sge i32 %91, 0
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  store i32 10, ptr %8, align 4
  br label %131

94:                                               ; preds = %90
  %95 = load i32, ptr %14, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %96
  %98 = load i8, ptr %97, align 1, !tbaa !11
  %99 = sext i8 %98 to i32
  %100 = sub nsw i32 %99, 97
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = icmp ne i32 %100, %101
  br i1 %102, label %109, label %103

103:                                              ; preds = %94
  %104 = load i32, ptr %14, align 4, !tbaa !5
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %103, %94
  br label %128

110:                                              ; preds = %103
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !11
  %115 = sext i8 %114 to i32
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = load i32, ptr %14, align 4, !tbaa !5
  %118 = add nsw i32 %116, %117
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = sub nsw i32 %118, %119
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !11
  %124 = sext i8 %123 to i32
  %125 = icmp eq i32 %115, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %110
  store i8 0, ptr %13, align 1, !tbaa !14
  store i32 10, ptr %8, align 4
  br label %131

127:                                              ; preds = %110
  br label %128

128:                                              ; preds = %127, %109
  %129 = load i32, ptr %14, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %14, align 4, !tbaa !5
  br label %90, !llvm.loop !16

131:                                              ; preds = %126, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %132

132:                                              ; preds = %131
  %133 = load i8, ptr %13, align 1, !tbaa !14, !range !17, !noundef !18
  %134 = trunc i8 %133 to i1
  br i1 %134, label %135, label %145

135:                                              ; preds = %132
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = add nsw i32 97, %136
  %138 = trunc i32 %137 to i8
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %140
  store i8 %138, ptr %141, align 1, !tbaa !11
  %142 = load i32, ptr %3, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  %144 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z3genii(i32 noundef %143, i32 noundef %144)
  br label %145

145:                                              ; preds = %135, %132
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %12, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %12, align 4, !tbaa !5
  br label %82, !llvm.loop !19

149:                                              ; preds = %86, %80
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !13}
!17 = !{i8 0, i8 2}
!18 = !{}
!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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@ids = external dso_local global [4 x [51 x %"class.std::vector"]], align 16
@p = external dso_local local_unnamed_addr global [50 x [50 x i8]], align 16
@k = external dso_local local_unnamed_addr global [50 x i32], align 16
@ans = external dso_local local_unnamed_addr global [50 x i32], align 16
@q = external dso_local local_unnamed_addr global [50 x i8], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3genii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = sext i32 %1 to i64
  %6 = sext i32 %0 to i64
  %7 = getelementptr inbounds [4 x [51 x %"class.std::vector"]], ptr @ids, i64 0, i64 %5, i64 %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %8 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %8, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %9 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %9, ptr %4, align 8
  %10 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %10, label %.lr.ph47, label %._crit_edge48

.lr.ph47:                                         ; preds = %2
  %11 = icmp sgt i32 %0, 0
  br i1 %11, label %.lr.ph.us.preheader, label %.lr.ph47.split

.lr.ph.us.preheader:                              ; preds = %.lr.ph47
  %wide.trip.count = zext nneg i32 %0 to i64
  %min.iters.check = icmp ult i32 %0, 8
  %n.vec = and i64 %wide.trip.count, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %31
  %12 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph.us
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.us ], [ %n.vec, %middle.block ]
  %.03744.us.ph = phi i32 [ 0, %.lr.ph.us ], [ %26, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.lr.ph.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.lr.ph.us ]
  %vec.phi = phi <4 x i32> [ %23, %vector.body ], [ zeroinitializer, %.lr.ph.us ]
  %vec.phi64 = phi <4 x i32> [ %24, %vector.body ], [ zeroinitializer, %.lr.ph.us ]
  %15 = getelementptr inbounds [50 x [50 x i8]], ptr @p, i64 0, i64 %14, i64 %index
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  %wide.load = load <4 x i8>, ptr %15, align 2, !tbaa !9
  %wide.load65 = load <4 x i8>, ptr %16, align 2, !tbaa !9
  %17 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %index
  %18 = getelementptr inbounds i8, ptr %17, i64 4
  %wide.load66 = load <4 x i8>, ptr %17, align 8, !tbaa !9
  %wide.load67 = load <4 x i8>, ptr %18, align 4, !tbaa !9
  %19 = icmp ne <4 x i8> %wide.load, %wide.load66
  %20 = icmp ne <4 x i8> %wide.load65, %wide.load67
  %21 = zext <4 x i1> %19 to <4 x i32>
  %22 = zext <4 x i1> %20 to <4 x i32>
  %23 = add <4 x i32> %vec.phi, %21
  %24 = add <4 x i32> %vec.phi64, %22
  %index.next = add nuw i64 %index, 8
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %24, %23
  %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

27:                                               ; preds = %._crit_edge.us
  %28 = getelementptr inbounds [50 x i32], ptr @ans, i64 0, i64 %14
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %27, %._crit_edge.us
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %33 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %33, label %.lr.ph.us, label %._crit_edge48

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.03744.us = phi i32 [ %40, %scalar.ph ], [ %.03744.us.ph, %scalar.ph.preheader ]
  %34 = getelementptr inbounds [50 x [50 x i8]], ptr @p, i64 0, i64 %14, i64 %indvars.iv
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %indvars.iv
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = icmp ne i8 %35, %37
  %39 = zext i1 %38 to i32
  %40 = add nuw nsw i32 %.03744.us, %39
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph, !llvm.loop !14

._crit_edge.us:                                   ; preds = %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %26, %middle.block ], [ %40, %scalar.ph ]
  %41 = getelementptr inbounds [50 x i32], ptr @k, i64 0, i64 %14
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %.not41.us = icmp sgt i32 %.lcssa, %42
  br i1 %.not41.us, label %31, label %27

._crit_edge48:                                    ; preds = %60, %31, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %43 = icmp ne i32 %0, 26
  %44 = icmp sgt i32 %1, 0
  %or.cond = and i1 %43, %44
  br i1 %or.cond, label %.preheader.lr.ph, label %.loopexit43

.preheader.lr.ph:                                 ; preds = %._crit_edge48
  %45 = icmp slt i32 %0, 1
  %46 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %6
  %47 = add nsw i32 %0, 1
  br i1 %45, label %.preheader.us, label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %.preheader.us
  %.03551.us = phi i32 [ %50, %.preheader.us ], [ 0, %.preheader.lr.ph ]
  %48 = trunc i32 %.03551.us to i8
  %49 = add i8 %48, 97
  store i8 %49, ptr %46, align 1, !tbaa !9
  call void @_Z3genii(i32 noundef %47, i32 noundef %1)
  %50 = add nuw nsw i32 %.03551.us, 1
  %exitcond59.not = icmp eq i32 %50, %1
  br i1 %exitcond59.not, label %.loopexit43, label %.preheader.us, !llvm.loop !15

.lr.ph47.split:                                   ; preds = %.lr.ph47, %60
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [50 x i32], ptr @k, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %.not41 = icmp slt i32 %55, 0
  br i1 %.not41, label %60, label %56

56:                                               ; preds = %.lr.ph47.split
  %57 = getelementptr inbounds [50 x i32], ptr @ans, i64 0, i64 %53
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %56, %.lr.ph47.split
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %62 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %62, label %.lr.ph47.split, label %._crit_edge48

.preheader:                                       ; preds = %.preheader.lr.ph, %.loopexit
  %.03551 = phi i32 [ %80, %.loopexit ], [ 0, %.preheader.lr.ph ]
  br label %63

63:                                               ; preds = %.preheader, %76
  %indvars.iv55 = phi i64 [ %6, %.preheader ], [ %indvars.iv.next56, %76 ]
  %indvars.iv.next56 = add nsw i64 %indvars.iv55, -1
  %64 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %indvars.iv.next56
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = sext i8 %65 to i32
  %67 = add nsw i32 %66, -97
  %.not = icmp eq i32 %67, %.03551
  br i1 %.not, label %68, label %76

68:                                               ; preds = %63
  %69 = shl nuw nsw i64 %indvars.iv.next56, 1
  %70 = icmp slt i64 %69, %6
  br i1 %70, label %76, label %71

71:                                               ; preds = %68
  %72 = sub nsw i64 %69, %6
  %73 = getelementptr inbounds [50 x i8], ptr @q, i64 0, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !9
  %75 = icmp eq i8 %65, %74
  br i1 %75, label %.loopexit, label %76

76:                                               ; preds = %71, %63, %68
  %77 = icmp slt i64 %indvars.iv55, 2
  br i1 %77, label %..critedge_crit_edge, label %63, !llvm.loop !16

..critedge_crit_edge:                             ; preds = %76
  %78 = trunc i32 %.03551 to i8
  %79 = add i8 %78, 97
  store i8 %79, ptr %46, align 1, !tbaa !9
  call void @_Z3genii(i32 noundef %47, i32 noundef %1)
  br label %.loopexit

.loopexit:                                        ; preds = %71, %..critedge_crit_edge
  %80 = add nuw nsw i32 %.03551, 1
  %exitcond58.not = icmp eq i32 %80, %1
  br i1 %exitcond58.not, label %.loopexit43, label %.preheader, !llvm.loop !15

.loopexit43:                                      ; preds = %.loopexit, %.preheader.us, %._crit_edge48
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}


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