; LLVM IR from eyangch/competitive-programming :: Codeforces/1362 (b)

; 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [1024 x i8], align 16
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [1024 x i8], align 16
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %23

23:                                               ; preds = %113, %0
  %24 = load i32, ptr %2, align 4, !tbaa !8
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %2, align 4, !tbaa !8
  %26 = icmp ne i32 %24, 0
  br i1 %26, label %27, label %118

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 1024, ptr %4) #7
  %29 = getelementptr inbounds [1024 x i8], ptr %4, i64 0, i64 0
  %30 = getelementptr inbounds [1024 x i8], ptr %4, i64 0, i64 0
  %31 = getelementptr inbounds i8, ptr %30, i64 1024
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  store i8 0, ptr %5, align 1, !tbaa !11
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef %29, ptr noundef %31, ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  %32 = load i32, ptr %3, align 4, !tbaa !8
  %33 = zext i32 %32 to i64
  %34 = call ptr @llvm.stacksave.p0()
  store ptr %34, ptr %6, align 8
  %35 = alloca i32, i64 %33, align 16
  store i64 %33, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %36

36:                                               ; preds = %52, %27
  %37 = load i32, ptr %8, align 4, !tbaa !8
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %55

41:                                               ; preds = %36
  %42 = load i32, ptr %8, align 4, !tbaa !8
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr %35, i64 %43
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %44)
  %46 = load i32, ptr %8, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %35, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1024 x i8], ptr %4, i64 0, i64 %50
  store i8 1, ptr %51, align 1, !tbaa !11
  br label %52

52:                                               ; preds = %41
  %53 = load i32, ptr %8, align 4, !tbaa !8
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %8, align 4, !tbaa !8
  br label %36, !llvm.loop !13

55:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 -1, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %109, %55
  %57 = load i32, ptr %10, align 4, !tbaa !8
  %58 = icmp slt i32 %57, 1024
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 7, ptr %11, align 4
  br label %112

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 1024, ptr %12) #7
  %61 = getelementptr inbounds [1024 x i8], ptr %4, i64 0, i64 0
  %62 = getelementptr inbounds [1024 x i8], ptr %4, i64 0, i64 0
  %63 = getelementptr inbounds i8, ptr %62, i64 1024
  %64 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 0
  %65 = call noundef ptr @_ZSt4copyIPbS0_ET0_T_S2_S1_(ptr noundef %61, ptr noundef %63, ptr noundef %64)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %66

66:                                               ; preds = %80, %60
  %67 = load i32, ptr %13, align 4, !tbaa !8
  %68 = load i32, ptr %3, align 4, !tbaa !8
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %83

71:                                               ; preds = %66
  %72 = load i32, ptr %13, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %35, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = load i32, ptr %10, align 4, !tbaa !8
  %77 = xor i32 %75, %76
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 %78
  store i8 0, ptr %79, align 1, !tbaa !11
  br label %80

80:                                               ; preds = %71
  %81 = load i32, ptr %13, align 4, !tbaa !8
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %13, align 4, !tbaa !8
  br label %66, !llvm.loop !15

83:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  store i8 1, ptr %14, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %84

84:                                               ; preds = %96, %83
  %85 = load i32, ptr %15, align 4, !tbaa !8
  %86 = icmp slt i32 %85, 1024
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  store i32 13, ptr %11, align 4
  br label %99

88:                                               ; preds = %84
  %89 = load i32, ptr %15, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !11, !range !16, !noundef !17
  %93 = trunc i8 %92 to i1
  br i1 %93, label %94, label %95

94:                                               ; preds = %88
  store i8 0, ptr %14, align 1, !tbaa !11
  store i32 13, ptr %11, align 4
  br label %99

95:                                               ; preds = %88
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %15, align 4, !tbaa !8
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %15, align 4, !tbaa !8
  br label %84, !llvm.loop !18

99:                                               ; preds = %94, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %100

100:                                              ; preds = %99
  %101 = load i8, ptr %14, align 1, !tbaa !11, !range !16, !noundef !17
  %102 = trunc i8 %101 to i1
  br i1 %102, label %103, label %105

103:                                              ; preds = %100
  %104 = load i32, ptr %10, align 4, !tbaa !8
  store i32 %104, ptr %9, align 4, !tbaa !8
  store i32 7, ptr %11, align 4
  br label %106

105:                                              ; preds = %100
  store i32 0, ptr %11, align 4
  br label %106

106:                                              ; preds = %105, %103
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %12) #7
  %107 = load i32, ptr %11, align 4
  switch i32 %107, label %112 [
    i32 0, label %108
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %10, align 4, !tbaa !8
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !8
  br label %56, !llvm.loop !19

112:                                              ; preds = %106, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %9, align 4, !tbaa !8
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %114)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %117 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %117)
  call void @llvm.lifetime.end.p0(i64 1024, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %23, !llvm.loop !20

118:                                              ; preds = %23
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %119 = load i32, ptr %1, align 4
  ret i32 %119
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPbS0_ET0_T_S2_S1_(ptr noundef, ptr noundef, ptr noundef) #4

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { "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 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 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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [1024 x i8], align 16
  %4 = alloca i8, align 1
  %5 = alloca [1024 x i8], align 16
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %13 = load i32, ptr %1, align 4, !tbaa !8
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %1, align 4, !tbaa !8
  %.not33 = icmp eq i32 %13, 0
  br i1 %.not33, label %._crit_edge, label %.lr.ph34

.lr.ph34:                                         ; preds = %0
  %15 = getelementptr inbounds i8, ptr %3, i64 1024
  br label %16

16:                                               ; preds = %.lr.ph34, %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  store i8 0, ptr %4, align 1, !tbaa !11
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull %3, ptr noundef nonnull %15, ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  %18 = load i32, ptr %2, align 4, !tbaa !8
  %19 = zext i32 %18 to i64
  %20 = call ptr @llvm.stacksave.p0()
  %21 = alloca i32, i64 %19, align 16
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %.preheader26.preheader

.lr.ph:                                           ; preds = %16, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %16 ]
  %24 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %26 = load i32, ptr %24, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 %27
  store i8 1, ptr %28, align 1, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %.preheader26.preheader, !llvm.loop !13

.preheader26.preheader:                           ; preds = %.lr.ph, %16
  br label %.preheader26

.preheader26:                                     ; preds = %.preheader26.preheader, %87
  %.02132 = phi i32 [ %88, %87 ], [ 1, %.preheader26.preheader ]
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #7
  %32 = call noundef ptr @_ZSt4copyIPbS0_ET0_T_S2_S1_(ptr noundef nonnull %3, ptr noundef nonnull %15, ptr noundef nonnull %5)
  %33 = load i32, ptr %2, align 4, !tbaa !8
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph30.preheader, label %.preheader.preheader

.lr.ph30.preheader:                               ; preds = %.preheader26
  %wide.trip.count = zext nneg i32 %33 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %35 = icmp ult i32 %33, 4
  br i1 %35, label %.preheader.preheader.loopexit.unr-lcssa, label %.lr.ph30.preheader.new

.lr.ph30.preheader.new:                           ; preds = %.lr.ph30.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph30

.lr.ph30:                                         ; preds = %.lr.ph30, %.lr.ph30.preheader.new
  %indvars.iv37 = phi i64 [ 0, %.lr.ph30.preheader.new ], [ %indvars.iv.next38.3, %.lr.ph30 ]
  %niter = phi i64 [ 0, %.lr.ph30.preheader.new ], [ %niter.next.3, %.lr.ph30 ]
  %36 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv37
  %37 = load i32, ptr %36, align 16, !tbaa !8
  %38 = xor i32 %37, %.02132
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %39
  store i8 0, ptr %40, align 1, !tbaa !11
  %indvars.iv.next38 = or disjoint i64 %indvars.iv37, 1
  %41 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.next38
  %42 = load i32, ptr %41, align 4, !tbaa !8
  %43 = xor i32 %42, %.02132
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %44
  store i8 0, ptr %45, align 1, !tbaa !11
  %indvars.iv.next38.1 = or disjoint i64 %indvars.iv37, 2
  %46 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.next38.1
  %47 = load i32, ptr %46, align 8, !tbaa !8
  %48 = xor i32 %47, %.02132
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %49
  store i8 0, ptr %50, align 1, !tbaa !11
  %indvars.iv.next38.2 = or disjoint i64 %indvars.iv37, 3
  %51 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.next38.2
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = xor i32 %52, %.02132
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %54
  store i8 0, ptr %55, align 1, !tbaa !11
  %indvars.iv.next38.3 = add nuw nsw i64 %indvars.iv37, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.preheader.loopexit.unr-lcssa, label %.lr.ph30, !llvm.loop !15

.preheader.preheader.loopexit.unr-lcssa:          ; preds = %.lr.ph30, %.lr.ph30.preheader
  %indvars.iv37.unr = phi i64 [ 0, %.lr.ph30.preheader ], [ %indvars.iv.next38.3, %.lr.ph30 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.preheader, label %.lr.ph30.epil

.lr.ph30.epil:                                    ; preds = %.preheader.preheader.loopexit.unr-lcssa, %.lr.ph30.epil
  %indvars.iv37.epil = phi i64 [ %indvars.iv.next38.epil, %.lr.ph30.epil ], [ %indvars.iv37.unr, %.preheader.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph30.epil ], [ 0, %.preheader.preheader.loopexit.unr-lcssa ]
  %56 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv37.epil
  %57 = load i32, ptr %56, align 4, !tbaa !8
  %58 = xor i32 %57, %.02132
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %59
  store i8 0, ptr %60, align 1, !tbaa !11
  %indvars.iv.next38.epil = add nuw nsw i64 %indvars.iv37.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader.preheader, label %.lr.ph30.epil, !llvm.loop !16

.preheader.preheader:                             ; preds = %.preheader.preheader.loopexit.unr-lcssa, %.lr.ph30.epil, %.preheader26
  br label %.preheader

.preheader.1:                                     ; preds = %.preheader
  %indvars.iv.next41 = or disjoint i64 %indvars.iv40, 1
  %61 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv.next41
  %62 = load i8, ptr %61, align 1, !tbaa !11, !range !18, !noundef !19
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %87, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %indvars.iv.next41.1 = or disjoint i64 %indvars.iv40, 2
  %64 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv.next41.1
  %65 = load i8, ptr %64, align 2, !tbaa !11, !range !18, !noundef !19
  %66 = trunc nuw i8 %65 to i1
  br i1 %66, label %87, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  %indvars.iv.next41.2 = or disjoint i64 %indvars.iv40, 3
  %67 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv.next41.2
  %68 = load i8, ptr %67, align 1, !tbaa !11, !range !18, !noundef !19
  %69 = trunc nuw i8 %68 to i1
  br i1 %69, label %87, label %.preheader.4

.preheader.4:                                     ; preds = %.preheader.3
  %indvars.iv.next41.3 = or disjoint i64 %indvars.iv40, 4
  %70 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv.next41.3
  %71 = load i8, ptr %70, align 4, !tbaa !11, !range !18, !noundef !19
  %72 = trunc nuw i8 %71 to i1
  br i1 %72, label %87, label %.preheader.5

.preheader.5:                                     ; preds = %.preheader.4
  %indvars.iv.next41.4 = or disjoint i64 %indvars.iv40, 5
  %73 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv.next41.4
  %74 = load i8, ptr %73, align 1, !tbaa !11, !range !18, !noundef !19
  %75 = trunc nuw i8 %74 to i1
  br i1 %75, label %87, label %.preheader.6

.preheader.6:                                     ; preds = %.preheader.5
  %indvars.iv.next41.5 = or disjoint i64 %indvars.iv40, 6
  %76 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv.next41.5
  %77 = load i8, ptr %76, align 2, !tbaa !11, !range !18, !noundef !19
  %78 = trunc nuw i8 %77 to i1
  br i1 %78, label %87, label %.preheader.7

.preheader.7:                                     ; preds = %.preheader.6
  %indvars.iv.next41.6 = or disjoint i64 %indvars.iv40, 7
  %79 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv.next41.6
  %80 = load i8, ptr %79, align 1, !tbaa !11, !range !18, !noundef !19
  %81 = trunc nuw i8 %80 to i1
  br i1 %81, label %87, label %82

82:                                               ; preds = %.preheader.7
  %indvars.iv.next41.7 = add nuw nsw i64 %indvars.iv40, 8
  %exitcond43.not.7 = icmp eq i64 %indvars.iv.next41.7, 1024
  br i1 %exitcond43.not.7, label %86, label %.preheader, !llvm.loop !20

.preheader:                                       ; preds = %82, %.preheader.preheader
  %indvars.iv40 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next41.7, %82 ]
  %83 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 %indvars.iv40
  %84 = load i8, ptr %83, align 8, !tbaa !11, !range !18, !noundef !19
  %85 = trunc nuw i8 %84 to i1
  br i1 %85, label %87, label %.preheader.1

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #7
  br label %.loopexit

87:                                               ; preds = %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #7
  %88 = add nuw nsw i32 %.02132, 1
  %exitcond44.not = icmp eq i32 %88, 1024
  br i1 %exitcond44.not, label %.loopexit, label %.preheader26, !llvm.loop !21

.loopexit:                                        ; preds = %87, %86
  %.2 = phi i32 [ %.02132, %86 ], [ -1, %87 ]
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.2)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %20)
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %91 = load i32, ptr %1, align 4, !tbaa !8
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %91, 0
  br i1 %.not, label %._crit_edge, label %16, !llvm.loop !22

._crit_edge:                                      ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

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 #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) 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) #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPbS0_ET0_T_S2_S1_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { "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 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 = { mustprogress 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 nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


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