; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100624I)

; 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"

%"struct.std::pair" = type { i64, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@b = external dso_local global [101 x i32], align 16
@c = external dso_local global [101 x i32], align 16
@cnt = external dso_local global i32, align 4
@h = external dso_local global [50001 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @t)
  br label %12

12:                                               ; preds = %143, %0
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @t, align 4, !tbaa !5
  %15 = icmp ne i32 %13, 0
  br i1 %15, label %16, label %163

16:                                               ; preds = %12
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @m)
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %66, %16
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %69

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %26
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %27)
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %29
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %30)
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %32
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %33)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %62, %24
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %65

39:                                               ; preds = %34
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = mul nsw i32 %43, %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = mul nsw i32 %52, %56
  %58 = icmp ne i32 %48, %57
  %59 = zext i1 %58 to i32
  %60 = load i32, ptr @cnt, align 4, !tbaa !5
  %61 = add nsw i32 %60, %59
  store i32 %61, ptr @cnt, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %39
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %4, align 4, !tbaa !5
  br label %34, !llvm.loop !9

65:                                               ; preds = %38
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !11

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

70:                                               ; preds = %140, %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = load i32, ptr @m, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %143

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [50001 x %"struct.std::pair"], ptr @h, i64 0, i64 %77
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %136, %75
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %139

85:                                               ; preds = %80
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = mul nsw i64 %90, %92
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = mul nsw i64 %98, %100
  %102 = add nsw i64 %93, %101
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = add nsw i64 %102, %107
  %109 = icmp sgt i64 %108, 0
  br i1 %109, label %110, label %135

110:                                              ; preds = %85
  %111 = load i32, ptr %11, align 4, !tbaa !5
  %112 = icmp slt i32 %111, 50
  br i1 %112, label %113, label %123

113:                                              ; preds = %110
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = zext i32 %114 to i64
  %116 = shl i64 1, %115
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [50001 x %"struct.std::pair"], ptr @h, i64 0, i64 %118
  %120 = getelementptr inbounds %"struct.std::pair", ptr %119, i32 0, i32 0
  %121 = load i64, ptr %120, align 16, !tbaa !12
  %122 = or i64 %121, %116
  store i64 %122, ptr %120, align 16, !tbaa !12
  br label %134

123:                                              ; preds = %110
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 50
  %126 = zext i32 %125 to i64
  %127 = shl i64 1, %126
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [50001 x %"struct.std::pair"], ptr @h, i64 0, i64 %129
  %131 = getelementptr inbounds %"struct.std::pair", ptr %130, i32 0, i32 1
  %132 = load i64, ptr %131, align 8, !tbaa !15
  %133 = or i64 %132, %127
  store i64 %133, ptr %131, align 8, !tbaa !15
  br label %134

134:                                              ; preds = %123, %113
  br label %135

135:                                              ; preds = %134, %85
  br label %136

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

139:                                              ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %5, align 4, !tbaa !5
  br label %70, !llvm.loop !17

143:                                              ; preds = %74
  %144 = load i32, ptr @m, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds %"struct.std::pair", ptr @h, i64 %145
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef @h, ptr noundef %146)
  %147 = load i32, ptr @m, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds %"struct.std::pair", ptr @h, i64 %148
  %150 = call noundef ptr @_ZSt6uniqueIPSt4pairIxxEET_S3_S3_(ptr noundef @h, ptr noundef %149)
  %151 = ptrtoint ptr %150 to i64
  %152 = sub i64 %151, ptrtoint (ptr @h to i64)
  %153 = sdiv exact i64 %152, 16
  %154 = load i32, ptr @cnt, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = sub nsw i64 %155, %153
  %157 = trunc i64 %156 to i32
  store i32 %157, ptr @cnt, align 4, !tbaa !5
  %158 = load i32, ptr @cnt, align 4, !tbaa !5
  %159 = icmp ne i32 %158, 0
  %160 = zext i1 %159 to i64
  %161 = select i1 %159, ptr @.str, ptr @.str.1
  %162 = call i32 @puts(ptr noundef %161)
  br label %12, !llvm.loop !18

163:                                              ; preds = %12
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #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 nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

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

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

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

declare i32 @puts(ptr 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 = { 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 = { 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 = { 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 = { "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 }

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

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


; 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"

%"struct.std::pair" = type { i64, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@b = external dso_local global [101 x i32], align 16
@c = external dso_local global [101 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@h = external dso_local global [50001 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  tail call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @t)
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @t, align 4, !tbaa !5
  %.not42 = icmp eq i32 %6, 0
  br i1 %.not42, label %._crit_edge45, label %.lr.ph44

.lr.ph44:                                         ; preds = %0, %._crit_edge41
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @m)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = add nsw i32 %8, 1
  store i32 %9, ptr @cnt, align 4, !tbaa !5
  %10 = icmp sgt i32 %8, 0
  br i1 %10, label %.lr.ph34, label %.preheader

.preheader:                                       ; preds = %35, %.lr.ph44
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph40, label %.preheader.._crit_edge41_crit_edge

.preheader.._crit_edge41_crit_edge:               ; preds = %.preheader
  %.pre = sext i32 %11 to i64
  br label %._crit_edge41

.lr.ph34:                                         ; preds = %.lr.ph44, %35
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %35 ], [ 0, %.lr.ph44 ]
  %13 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv50
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %13)
  %14 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv50
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %14)
  %15 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv50
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %15)
  %.not46 = icmp eq i64 %indvars.iv50, 0
  br i1 %.not46, label %35, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph34
  %cnt.promoted = load i32, ptr @cnt, align 4, !tbaa !5
  %16 = load i32, ptr %13, align 4, !tbaa !5
  %17 = load i32, ptr %14, align 4, !tbaa !5
  %min.iters.check = icmp ult i64 %indvars.iv50, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %indvars.iv50, 9223372036854775800
  %18 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.promoted, i64 0
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %16, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert66 = insertelement <4 x i32> poison, i32 %17, i64 0
  %broadcast.splat67 = shufflevector <4 x i32> %broadcast.splatinsert66, <4 x i32> 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.phi = phi <4 x i32> [ %18, %vector.ph ], [ %31, %vector.body ]
  %vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %32, %vector.body ]
  %19 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %wide.load = load <4 x i32>, ptr %19, align 16, !tbaa !5
  %wide.load63 = load <4 x i32>, ptr %20, align 16, !tbaa !5
  %21 = mul nsw <4 x i32> %wide.load, %broadcast.splat
  %22 = mul nsw <4 x i32> %wide.load63, %broadcast.splat
  %23 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %index
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %wide.load64 = load <4 x i32>, ptr %23, align 16, !tbaa !5
  %wide.load65 = load <4 x i32>, ptr %24, align 16, !tbaa !5
  %25 = mul nsw <4 x i32> %wide.load64, %broadcast.splat67
  %26 = mul nsw <4 x i32> %wide.load65, %broadcast.splat67
  %27 = icmp ne <4 x i32> %21, %25
  %28 = icmp ne <4 x i32> %22, %26
  %29 = zext <4 x i1> %27 to <4 x i32>
  %30 = zext <4 x i1> %28 to <4 x i32>
  %31 = add <4 x i32> %vec.phi, %29
  %32 = add <4 x i32> %vec.phi62, %30
  %index.next = add nuw i64 %index, 8
  %33 = icmp eq i64 %index.next, %n.vec
  br i1 %33, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %32, %31
  %34 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %indvars.iv50, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %34, %middle.block ], [ %48, %scalar.ph ]
  store i32 %.lcssa, ptr @cnt, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %._crit_edge, %.lr.ph34
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next51, %37
  br i1 %38, label %.lr.ph34, label %.preheader, !llvm.loop !13

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %39 = phi i32 [ %48, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %40 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = mul nsw i32 %41, %16
  %43 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = mul nsw i32 %44, %17
  %46 = icmp ne i32 %42, %45
  %47 = zext i1 %46 to i32
  %48 = add nsw i32 %39, %47
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv50
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !14

._crit_edge41:                                    ; preds = %._crit_edge38, %.preheader.._crit_edge41_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge41_crit_edge ], [ %74, %._crit_edge38 ]
  %49 = getelementptr inbounds %"struct.std::pair", ptr @h, i64 %.pre-phi
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull @h, ptr noundef nonnull %49)
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds %"struct.std::pair", ptr @h, i64 %51
  %53 = call noundef ptr @_ZSt6uniqueIPSt4pairIxxEET_S3_S3_(ptr noundef nonnull @h, ptr noundef nonnull %52)
  %54 = ptrtoint ptr %53 to i64
  %55 = sub i64 %54, ptrtoint (ptr @h to i64)
  %56 = lshr exact i64 %55, 4
  %57 = load i32, ptr @cnt, align 4, !tbaa !5
  %58 = trunc i64 %56 to i32
  %59 = sub i32 %57, %58
  store i32 %59, ptr @cnt, align 4, !tbaa !5
  %.not29 = icmp eq i32 %57, %58
  %60 = select i1 %.not29, ptr @.str.1, ptr @.str
  %61 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %60)
  %62 = load i32, ptr @t, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %62, 0
  br i1 %.not, label %._crit_edge45, label %.lr.ph44, !llvm.loop !15

.lr.ph40:                                         ; preds = %.preheader, %._crit_edge38
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %._crit_edge38 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %64 = getelementptr inbounds [50001 x %"struct.std::pair"], ptr @h, i64 0, i64 %indvars.iv57
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph37, label %._crit_edge38

.lr.ph37:                                         ; preds = %.lr.ph40
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %64, i64 8
  %wide.trip.count = zext nneg i32 %66 to i64
  br label %76

._crit_edge38:                                    ; preds = %102, %.lr.ph40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next58, %74
  br i1 %75, label %.lr.ph40, label %._crit_edge41, !llvm.loop !16

76:                                               ; preds = %.lr.ph37, %102
  %indvars.iv53 = phi i64 [ 0, %.lr.ph37 ], [ %indvars.iv.next54, %102 ]
  %77 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv53
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = mul nsw i64 %69, %79
  %81 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv53
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = mul nsw i64 %71, %83
  %85 = add nsw i64 %84, %80
  %86 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv53
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = add nsw i64 %85, %88
  %90 = icmp sgt i64 %89, 0
  br i1 %90, label %91, label %102

91:                                               ; preds = %76
  %92 = icmp ult i64 %indvars.iv53, 50
  br i1 %92, label %93, label %97

93:                                               ; preds = %91
  %94 = shl nuw nsw i64 1, %indvars.iv53
  %95 = load i64, ptr %64, align 16, !tbaa !17
  %96 = or i64 %95, %94
  store i64 %96, ptr %64, align 16, !tbaa !17
  br label %102

97:                                               ; preds = %91
  %98 = add nsw i64 %indvars.iv53, -50
  %99 = shl nuw i64 1, %98
  %100 = load i64, ptr %72, align 8, !tbaa !20
  %101 = or i64 %100, %99
  store i64 %101, ptr %72, align 8, !tbaa !20
  br label %102

102:                                              ; preds = %76, %97, %93
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %exitcond56.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count
  br i1 %exitcond56.not, label %._crit_edge38, label %76, !llvm.loop !21

._crit_edge45:                                    ; preds = %._crit_edge41, %0
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) 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 nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x 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 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 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 = { 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTSSt4pairIxxE", !19, i64 0, !19, i64 8}
!19 = !{!"long long", !7, i64 0}
!20 = !{!18, !19, i64 8}
!21 = distinct !{!21, !10}


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