; LLVM IR from acm-clan/algorithm-stone :: user/codeforces/409H.A + B Strikes Back (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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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 [505 x i8], align 16
  %3 = alloca [505 x i8], align 16
  %4 = alloca [505 x i32], align 16
  %5 = alloca [505 x i32], align 16
  %6 = alloca [505 x i32], align 16
  %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 i8, align 1
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 505, ptr %2) #6
  call void @llvm.memset.p0.i64(ptr align 16 %2, i8 0, i64 505, i1 false)
  call void @llvm.lifetime.start.p0(i64 505, ptr %3) #6
  call void @llvm.memset.p0.i64(ptr align 16 %3, i8 0, i64 505, i1 false)
  call void @llvm.lifetime.start.p0(i64 2020, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 16 %4, i8 0, i64 2020, i1 false)
  call void @llvm.lifetime.start.p0(i64 2020, ptr %5) #6
  call void @llvm.memset.p0.i64(ptr align 16 %5, i8 0, i64 2020, i1 false)
  call void @llvm.lifetime.start.p0(i64 2020, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 2020, i1 false)
  %15 = getelementptr inbounds [505 x i8], ptr %2, i64 0, i64 0
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %15)
  %17 = getelementptr inbounds [505 x i8], ptr %3, i64 0, i64 0
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef %17)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %19 = getelementptr inbounds [505 x i8], ptr %2, i64 0, i64 0
  %20 = call i64 @strlen(ptr noundef %19) #7
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %22 = getelementptr inbounds [505 x i8], ptr %3, i64 0, i64 0
  %23 = call i64 @strlen(ptr noundef %22) #7
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %43, %0
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = load i32, ptr %9, align 4, !tbaa !5
  %33 = sub nsw i32 %31, %32
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [505 x i8], ptr %2, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = sext i8 %37 to i32
  %39 = sub nsw i32 %38, 48
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [505 x i32], ptr %4, i64 0, i64 %41
  store i32 %39, ptr %42, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %30
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %9, align 4, !tbaa !5
  br label %25, !llvm.loop !10

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

47:                                               ; preds = %65, %46
  %48 = load i32, ptr %10, align 4, !tbaa !5
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %68

52:                                               ; preds = %47
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = sub nsw i32 %53, %54
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [505 x i8], ptr %3, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !9
  %60 = sext i8 %59 to i32
  %61 = sub nsw i32 %60, 48
  %62 = load i32, ptr %10, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [505 x i32], ptr %5, i64 0, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %52
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %10, align 4, !tbaa !5
  br label %47, !llvm.loop !12

68:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = icmp sgt i32 %69, %70
  br i1 %71, label %72, label %74

72:                                               ; preds = %68
  %73 = load i32, ptr %7, align 4, !tbaa !5
  br label %76

74:                                               ; preds = %68
  %75 = load i32, ptr %8, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %74, %72
  %77 = phi i32 [ %73, %72 ], [ %75, %74 ]
  store i32 %77, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %122, %76
  %79 = load i32, ptr %12, align 4, !tbaa !5
  %80 = load i32, ptr %11, align 4, !tbaa !5
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %125

83:                                               ; preds = %78
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %12, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [505 x i32], ptr %4, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %87, %91
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [505 x i32], ptr %5, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %92, %96
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %99
  store i32 %97, ptr %100, align 4, !tbaa !5
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp sge i32 %104, 10
  br i1 %105, label %106, label %121

106:                                              ; preds = %83
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = srem i32 %110, 10
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %113
  store i32 %111, ptr %114, align 4, !tbaa !5
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %118, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %106, %83
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %12, align 4, !tbaa !5
  br label %78, !llvm.loop !13

125:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i8 0, ptr %13, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %126 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %126, ptr %14, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %151, %125
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = icmp sge i32 %128, 0
  br i1 %129, label %131, label %130

130:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %154

131:                                              ; preds = %127
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %140, label %137

137:                                              ; preds = %131
  %138 = load i32, ptr %14, align 4, !tbaa !5
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %141

140:                                              ; preds = %137, %131
  store i8 1, ptr %13, align 1, !tbaa !14
  br label %141

141:                                              ; preds = %140, %137
  %142 = load i8, ptr %13, align 1, !tbaa !14, !range !16, !noundef !17
  %143 = trunc i8 %142 to i1
  br i1 %143, label %144, label %150

144:                                              ; preds = %141
  %145 = load i32, ptr %14, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [505 x i32], ptr %6, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %148)
  br label %150

150:                                              ; preds = %144, %141
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %14, align 4, !tbaa !5
  %153 = add nsw i32 %152, -1
  store i32 %153, ptr %14, align 4, !tbaa !5
  br label %127, !llvm.loop !18

154:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 2020, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 2020, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 2020, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 505, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 505, ptr %2) #6
  ret i32 0
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

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

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

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 = { 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 = { nounwind willreturn memory(read) "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 = { "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 }
attributes #7 = { nounwind willreturn memory(read) }

!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}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !11}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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 [505 x i8], align 16
  %2 = alloca [505 x i8], align 16
  %3 = alloca [505 x i32], align 16
  %4 = alloca [505 x i32], align 16
  %5 = alloca [505 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 505, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(505) %1, i8 0, i64 505, i1 false)
  call void @llvm.lifetime.start.p0(i64 505, ptr nonnull %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(505) %2, i8 0, i64 505, i1 false)
  call void @llvm.lifetime.start.p0(i64 2020, ptr nonnull %3) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2020) %3, i8 0, i64 2020, i1 false)
  call void @llvm.lifetime.start.p0(i64 2020, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2020) %4, i8 0, i64 2020, i1 false)
  call void @llvm.lifetime.start.p0(i64 2020, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2020) %5, i8 0, i64 2020, i1 false)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %1)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef %2)
  %8 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #8
  %9 = trunc i64 %8 to i32
  %10 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #8
  %11 = trunc i64 %10 to i32
  %12 = icmp sgt i32 %9, 0
  br i1 %12, label %.lr.ph.preheader, label %.preheader45

.lr.ph.preheader:                                 ; preds = %0
  %13 = and i64 %8, 2147483647
  %wide.trip.count = and i64 %8, 2147483647
  %min.iters.check = icmp ult i64 %wide.trip.count, 8
  br i1 %min.iters.check, label %.lr.ph.preheader87, label %vector.ph

.lr.ph.preheader87:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.mod.vf = and i64 %8, 7
  %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %14 = xor i64 %index, -1
  %15 = add nsw i64 %13, %14
  %16 = getelementptr inbounds [505 x i8], ptr %1, i64 0, i64 %15
  %17 = getelementptr inbounds i8, ptr %16, i64 -3
  %18 = getelementptr inbounds i8, ptr %16, i64 -7
  %wide.load = load <4 x i8>, ptr %17, align 1, !tbaa !5
  %reverse = shufflevector <4 x i8> %wide.load, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load69 = load <4 x i8>, ptr %18, align 1, !tbaa !5
  %reverse70 = shufflevector <4 x i8> %wide.load69, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %19 = sext <4 x i8> %reverse to <4 x i32>
  %20 = sext <4 x i8> %reverse70 to <4 x i32>
  %21 = add nsw <4 x i32> %19, <i32 -48, i32 -48, i32 -48, i32 -48>
  %22 = add nsw <4 x i32> %20, <i32 -48, i32 -48, i32 -48, i32 -48>
  %23 = getelementptr inbounds [505 x i32], ptr %3, i64 0, i64 %index
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  store <4 x i32> %21, ptr %23, align 16, !tbaa !8
  store <4 x i32> %22, ptr %24, align 16, !tbaa !8
  %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
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %.preheader45, label %.lr.ph.preheader87

.preheader45:                                     ; preds = %.lr.ph, %middle.block, %0
  %26 = icmp sgt i32 %11, 0
  br i1 %26, label %.lr.ph48.preheader, label %._crit_edge

.lr.ph48.preheader:                               ; preds = %.preheader45
  %27 = and i64 %10, 2147483647
  %wide.trip.count60 = and i64 %10, 2147483647
  %min.iters.check73 = icmp ult i64 %wide.trip.count60, 8
  br i1 %min.iters.check73, label %.lr.ph48.preheader86, label %vector.ph74

.lr.ph48.preheader86:                             ; preds = %middle.block71, %.lr.ph48.preheader
  %indvars.iv57.ph = phi i64 [ 0, %.lr.ph48.preheader ], [ %n.vec76, %middle.block71 ]
  br label %.lr.ph48

vector.ph74:                                      ; preds = %.lr.ph48.preheader
  %n.mod.vf75 = and i64 %10, 7
  %n.vec76 = sub nsw i64 %wide.trip.count60, %n.mod.vf75
  br label %vector.body78

vector.body78:                                    ; preds = %vector.body78, %vector.ph74
  %index79 = phi i64 [ 0, %vector.ph74 ], [ %index.next84, %vector.body78 ]
  %28 = xor i64 %index79, -1
  %29 = add nsw i64 %27, %28
  %30 = getelementptr inbounds [505 x i8], ptr %2, i64 0, i64 %29
  %31 = getelementptr inbounds i8, ptr %30, i64 -3
  %32 = getelementptr inbounds i8, ptr %30, i64 -7
  %wide.load80 = load <4 x i8>, ptr %31, align 1, !tbaa !5
  %reverse81 = shufflevector <4 x i8> %wide.load80, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load82 = load <4 x i8>, ptr %32, align 1, !tbaa !5
  %reverse83 = shufflevector <4 x i8> %wide.load82, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %33 = sext <4 x i8> %reverse81 to <4 x i32>
  %34 = sext <4 x i8> %reverse83 to <4 x i32>
  %35 = add nsw <4 x i32> %33, <i32 -48, i32 -48, i32 -48, i32 -48>
  %36 = add nsw <4 x i32> %34, <i32 -48, i32 -48, i32 -48, i32 -48>
  %37 = getelementptr inbounds [505 x i32], ptr %4, i64 0, i64 %index79
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <4 x i32> %35, ptr %37, align 16, !tbaa !8
  store <4 x i32> %36, ptr %38, align 16, !tbaa !8
  %index.next84 = add nuw i64 %index79, 8
  %39 = icmp eq i64 %index.next84, %n.vec76
  br i1 %39, label %middle.block71, label %vector.body78, !llvm.loop !14

middle.block71:                                   ; preds = %vector.body78
  %cmp.n85 = icmp eq i64 %n.mod.vf75, 0
  br i1 %cmp.n85, label %._crit_edge, label %.lr.ph48.preheader86

.lr.ph:                                           ; preds = %.lr.ph.preheader87, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader87 ]
  %40 = xor i64 %indvars.iv, -1
  %41 = add nsw i64 %13, %40
  %42 = getelementptr inbounds [505 x i8], ptr %1, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !5
  %44 = sext i8 %43 to i32
  %45 = add nsw i32 %44, -48
  %46 = getelementptr inbounds [505 x i32], ptr %3, i64 0, i64 %indvars.iv
  store i32 %45, ptr %46, align 4, !tbaa !8
  %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 %.preheader45, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph48, %middle.block71, %.preheader45
  %47 = call i32 @llvm.smax.i32(i32 %9, i32 %11)
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph51.preheader, label %.preheader

.lr.ph51.preheader:                               ; preds = %._crit_edge
  %wide.trip.count65 = zext nneg i32 %47 to i64
  br label %.lr.ph51

.lr.ph48:                                         ; preds = %.lr.ph48.preheader86, %.lr.ph48
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %.lr.ph48 ], [ %indvars.iv57.ph, %.lr.ph48.preheader86 ]
  %49 = xor i64 %indvars.iv57, -1
  %50 = add nsw i64 %27, %49
  %51 = getelementptr inbounds [505 x i8], ptr %2, i64 0, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !5
  %53 = sext i8 %52 to i32
  %54 = add nsw i32 %53, -48
  %55 = getelementptr inbounds [505 x i32], ptr %4, i64 0, i64 %indvars.iv57
  store i32 %54, ptr %55, align 4, !tbaa !8
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %._crit_edge, label %.lr.ph48, !llvm.loop !16

.preheader:                                       ; preds = %73, %._crit_edge
  %56 = icmp sgt i32 %47, -1
  br i1 %56, label %.lr.ph54.preheader, label %._crit_edge55

.lr.ph54.preheader:                               ; preds = %.preheader
  %57 = zext nneg i32 %47 to i64
  br label %.lr.ph54

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %73
  %indvars.iv62 = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next63.pre-phi, %73 ]
  %58 = getelementptr inbounds [505 x i32], ptr %5, i64 0, i64 %indvars.iv62
  %59 = load i32, ptr %58, align 4, !tbaa !8
  %60 = getelementptr inbounds [505 x i32], ptr %3, i64 0, i64 %indvars.iv62
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %62 = add nsw i32 %61, %59
  %63 = getelementptr inbounds [505 x i32], ptr %4, i64 0, i64 %indvars.iv62
  %64 = load i32, ptr %63, align 4, !tbaa !8
  %65 = add nsw i32 %62, %64
  store i32 %65, ptr %58, align 4, !tbaa !8
  %66 = icmp sgt i32 %65, 9
  br i1 %66, label %67, label %.lr.ph51._crit_edge

.lr.ph51._crit_edge:                              ; preds = %.lr.ph51
  %.pre = add nuw nsw i64 %indvars.iv62, 1
  br label %73

67:                                               ; preds = %.lr.ph51
  %68 = urem i32 %65, 10
  store i32 %68, ptr %58, align 4, !tbaa !8
  %69 = add nuw nsw i64 %indvars.iv62, 1
  %70 = getelementptr inbounds [505 x i32], ptr %5, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %70, align 4, !tbaa !8
  br label %73

73:                                               ; preds = %.lr.ph51._crit_edge, %67
  %indvars.iv.next63.pre-phi = phi i64 [ %.pre, %.lr.ph51._crit_edge ], [ %69, %67 ]
  %exitcond66.not = icmp eq i64 %indvars.iv.next63.pre-phi, %wide.trip.count65
  br i1 %exitcond66.not, label %.preheader, label %.lr.ph51, !llvm.loop !17

._crit_edge55:                                    ; preds = %80, %.preheader
  call void @llvm.lifetime.end.p0(i64 2020, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 2020, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 2020, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 505, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 505, ptr nonnull %1) #7
  ret i32 0

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %80
  %indvars.iv67 = phi i64 [ %57, %.lr.ph54.preheader ], [ %indvars.iv.next68, %80 ]
  %.03552 = phi i1 [ false, %.lr.ph54.preheader ], [ %spec.select, %80 ]
  %74 = getelementptr inbounds [505 x i32], ptr %5, i64 0, i64 %indvars.iv67
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = icmp ne i32 %75, 0
  %77 = icmp eq i64 %indvars.iv67, 0
  %or.cond = or i1 %77, %76
  %spec.select = or i1 %or.cond, %.03552
  br i1 %spec.select, label %78, label %80

78:                                               ; preds = %.lr.ph54
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %75)
  br label %80

80:                                               ; preds = %.lr.ph54, %78
  %indvars.iv.next68 = add nsw i64 %indvars.iv67, -1
  %81 = icmp sgt i64 %indvars.iv67, 0
  br i1 %81, label %.lr.ph54, label %._crit_edge55, !llvm.loop !18
}

; 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 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 dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

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 = { 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 nofree nounwind willreturn memory(argmem: read) "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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, 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, !12, !13}
!15 = distinct !{!15, !11, !13, !12}
!16 = distinct !{!16, !11, !13, !12}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass