; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100540F)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@m = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@pos = external dso_local global [610061 x i32], align 16
@sz = external dso_local global [610061 x i32], align 16
@sa = external dso_local global [610061 x i32], align 16
@ht = external dso_local global [610061 x i32], align 16
@str = external dso_local global [610061 x i8], align 16
@tmp = external dso_local global [10001 x i8], align 16
@Hash = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8seg_initii(i32 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12suffix_arrayv() #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::set", align 8
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %8

8:                                                ; preds = %115, %0
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  %10 = icmp eq i32 %9, 1
  br i1 %10, label %11, label %14

11:                                               ; preds = %8
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp ne i32 %12, 0
  br label %14

14:                                               ; preds = %11, %8
  %15 = phi i1 [ false, %8 ], [ %13, %11 ]
  br i1 %15, label %16, label %119

16:                                               ; preds = %14
  store i32 0, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

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

21:                                               ; preds = %17
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %70

22:                                               ; preds = %17
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @tmp)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %24 = call i64 @strlen(ptr noundef @tmp) #8
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %50, %22
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %53

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [610061 x i32], ptr @pos, i64 0, i64 %34
  store i32 %32, ptr %35, align 4, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sub nsw i32 %36, %37
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [610061 x i32], ptr @sz, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [10001 x i8], ptr @tmp, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %46 to i64
  %49 = getelementptr inbounds [610061 x i8], ptr @str, i64 0, i64 %48
  store i8 %45, ptr %49, align 1, !tbaa !9
  br label %50

50:                                               ; preds = %31
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !10

53:                                               ; preds = %30
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [610061 x i32], ptr @sz, i64 0, i64 %55
  store i32 -1, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [610061 x i32], ptr @pos, i64 0, i64 %58
  store i32 -1, ptr %59, align 4, !tbaa !5
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  %62 = trunc i32 %61 to i8
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr @n, align 4, !tbaa !5
  %65 = sext i32 %63 to i64
  %66 = getelementptr inbounds [610061 x i8], ptr @str, i64 0, i64 %65
  store i8 %62, ptr %66, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %67

67:                                               ; preds = %53
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !12

70:                                               ; preds = %21
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [610061 x i8], ptr @str, i64 0, i64 %72
  store i8 0, ptr %73, align 1, !tbaa !9
  call void @_Z12suffix_arrayv()
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = sub nsw i32 %74, 1
  call void @_Z8seg_initii(i32 noundef 0, i32 noundef %75)
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #7
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 48, i1 false)
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @_ZNSt3setIxSt4lessIxESaIxEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(48) @Hash) #7
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %112, %70
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %115

81:                                               ; preds = %76
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [610061 x i32], ptr @sa, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [610061 x i32], ptr @pos, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = icmp eq i32 %88, -1
  br i1 %89, label %90, label %91

90:                                               ; preds = %81
  br label %112

91:                                               ; preds = %81
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [610061 x i32], ptr @ht, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %97, label %103

97:                                               ; preds = %91
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [610061 x i32], ptr @ht, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  call void @_Z5checkii(i32 noundef %98, i32 noundef %102)
  br label %103

103:                                              ; preds = %97, %91
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [610061 x i32], ptr @sa, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [610061 x i32], ptr @sz, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  call void @_Z5checkii(i32 noundef %104, i32 noundef %111)
  br label %112

112:                                              ; preds = %103, %90
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %76, !llvm.loop !13

115:                                              ; preds = %80
  %116 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #7
  %117 = trunc i64 %116 to i32
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %117)
  br label %8, !llvm.loop !14

119:                                              ; preds = %14
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

declare i32 @printf(ptr noundef, ...) #5

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

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 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #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 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 #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 = !{!"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 = distinct !{!14, !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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@m = external dso_local global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@pos = external dso_local local_unnamed_addr global [610061 x i32], align 16
@sz = external dso_local local_unnamed_addr global [610061 x i32], align 16
@sa = external dso_local local_unnamed_addr global [610061 x i32], align 16
@ht = external dso_local local_unnamed_addr global [610061 x i32], align 16
@str = external dso_local local_unnamed_addr global [610061 x i8], align 16
@tmp = external dso_local global [10001 x i8], align 16
@Hash = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8seg_initii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12suffix_arrayv() local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca %"class.std::set", align 8
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %3 = icmp eq i32 %2, 1
  %4 = load i32, ptr @m, align 4
  %5 = icmp ne i32 %4, 0
  %6 = select i1 %3, i1 %5, i1 false
  br i1 %6, label %.lr.ph32, label %._crit_edge33

.lr.ph32:                                         ; preds = %0, %._crit_edge30
  %7 = phi i32 [ %52, %._crit_edge30 ], [ %4, %0 ]
  store i32 0, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph25, label %._crit_edge26

._crit_edge26:                                    ; preds = %32, %.lr.ph32
  %9 = phi i32 [ 0, %.lr.ph32 ], [ %39, %32 ]
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [610061 x i8], ptr @str, i64 0, i64 %10
  store i8 0, ptr %11, align 1, !tbaa !9
  call void @_Z12suffix_arrayv()
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  call void @_Z8seg_initii(i32 noundef 0, i32 noundef %13)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %1, i8 0, i64 48, i1 false)
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  call void @_ZNSt3setIxSt4lessIxESaIxEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(48) @Hash) #8
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph29, label %._crit_edge30

.lr.ph25:                                         ; preds = %.lr.ph32, %32
  %.01923 = phi i32 [ %37, %32 ], [ 0, %.lr.ph32 ]
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @tmp)
  %17 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @tmp) #9
  %18 = trunc i64 %17 to i32
  %n.promoted = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph.preheader, label %32

.lr.ph.preheader:                                 ; preds = %.lr.ph25
  %20 = sext i32 %n.promoted to i64
  %scevgep = getelementptr i8, ptr @str, i64 %20
  %21 = and i64 %17, 2147483647
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 @tmp, i64 %21, i1 false), !tbaa !9
  %min.iters.check = icmp ult i64 %21, 8
  br i1 %min.iters.check, label %.lr.ph.preheader51, label %vector.ph

.lr.ph.preheader51:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv34.ph = phi i64 [ %20, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %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 %17, 7
  %n.vec = sub nsw i64 %21, %n.mod.vf
  %ind.end = add nsw i64 %n.vec, %20
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.01923, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert49 = insertelement <4 x i64> poison, i64 %17, i64 0
  %broadcast.splat50 = shufflevector <4 x i64> %broadcast.splatinsert49, <4 x i64> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
  %offset.idx = add i64 %index, %20
  %22 = getelementptr inbounds [610061 x i32], ptr @pos, i64 0, i64 %offset.idx
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <4 x i32> %broadcast.splat, ptr %22, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %23, align 4, !tbaa !5
  %24 = sub <4 x i64> %broadcast.splat50, %vec.ind
  %25 = sub <4 x i64> %broadcast.splat50, %step.add
  %26 = getelementptr inbounds [610061 x i32], ptr @sz, i64 0, i64 %offset.idx
  %27 = trunc <4 x i64> %24 to <4 x i32>
  %28 = trunc <4 x i64> %25 to <4 x i32>
  %29 = getelementptr inbounds i8, ptr %26, i64 16
  store <4 x i32> %27, ptr %26, align 4, !tbaa !5
  store <4 x i32> %28, ptr %29, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, 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 %._crit_edge, label %.lr.ph.preheader51

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %indvars.iv.next35.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next35, %.lr.ph ]
  %31 = trunc nsw i64 %indvars.iv.next35.lcssa to i32
  br label %32

32:                                               ; preds = %._crit_edge, %.lr.ph25
  %33 = phi i32 [ %31, %._crit_edge ], [ %n.promoted, %.lr.ph25 ]
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [610061 x i32], ptr @sz, i64 0, i64 %34
  store i32 -1, ptr %35, align 4, !tbaa !5
  %36 = getelementptr inbounds [610061 x i32], ptr @pos, i64 0, i64 %34
  store i32 -1, ptr %36, align 4, !tbaa !5
  %37 = add nuw nsw i32 %.01923, 1
  %38 = trunc i32 %37 to i8
  %39 = add nsw i32 %33, 1
  store i32 %39, ptr @n, align 4, !tbaa !5
  %40 = getelementptr inbounds [610061 x i8], ptr @str, i64 0, i64 %34
  store i8 %38, ptr %40, align 1, !tbaa !9
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = icmp slt i32 %37, %41
  br i1 %42, label %.lr.ph25, label %._crit_edge26, !llvm.loop !14

.lr.ph:                                           ; preds = %.lr.ph.preheader51, %.lr.ph
  %indvars.iv34 = phi i64 [ %indvars.iv.next35, %.lr.ph ], [ %indvars.iv34.ph, %.lr.ph.preheader51 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader51 ]
  %43 = getelementptr inbounds [610061 x i32], ptr @pos, i64 0, i64 %indvars.iv34
  store i32 %.01923, ptr %43, align 4, !tbaa !5
  %44 = sub i64 %17, %indvars.iv
  %45 = getelementptr inbounds [610061 x i32], ptr @sz, i64 0, i64 %indvars.iv34
  %46 = trunc i64 %44 to i32
  store i32 %46, ptr %45, align 4, !tbaa !5
  %indvars.iv.next35 = add nsw i64 %indvars.iv34, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %21
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge30:                                    ; preds = %70, %._crit_edge26
  %47 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #8
  %48 = trunc i64 %47 to i32
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %48)
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %51 = icmp eq i32 %50, 1
  %52 = load i32, ptr @m, align 4
  %53 = icmp ne i32 %52, 0
  %54 = select i1 %51, i1 %53, i1 false
  br i1 %54, label %.lr.ph32, label %._crit_edge33, !llvm.loop !16

.lr.ph29:                                         ; preds = %._crit_edge26, %70
  %55 = phi i32 [ %71, %70 ], [ %14, %._crit_edge26 ]
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %70 ], [ 0, %._crit_edge26 ]
  %56 = getelementptr inbounds [610061 x i32], ptr @sa, i64 0, i64 %indvars.iv39
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [610061 x i32], ptr @pos, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %60, -1
  br i1 %61, label %70, label %62

62:                                               ; preds = %.lr.ph29
  %63 = getelementptr inbounds [610061 x i32], ptr @ht, i64 0, i64 %indvars.iv39
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 0
  %66 = trunc nuw nsw i64 %indvars.iv39 to i32
  br i1 %65, label %67, label %._crit_edge44

67:                                               ; preds = %62
  call void @_Z5checkii(i32 noundef %66, i32 noundef %64)
  %.pre = load i32, ptr %56, align 4, !tbaa !5
  %.pre43 = sext i32 %.pre to i64
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %62, %67
  %.pre-phi = phi i64 [ %.pre43, %67 ], [ %58, %62 ]
  %68 = getelementptr inbounds [610061 x i32], ptr @sz, i64 0, i64 %.pre-phi
  %69 = load i32, ptr %68, align 4, !tbaa !5
  call void @_Z5checkii(i32 noundef %66, i32 noundef %69)
  %.pre42 = load i32, ptr @n, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %.lr.ph29, %._crit_edge44
  %71 = phi i32 [ %55, %.lr.ph29 ], [ %.pre42, %._crit_edge44 ]
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next40, %72
  br i1 %73, label %.lr.ph29, label %._crit_edge30, !llvm.loop !17

._crit_edge33:                                    ; preds = %._crit_edge30, %0
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { 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, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11, !13, !12}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass