; LLVM IR from upupming/algorithm :: acwing/寒假每日一题（提高组）/week1/1402. 星空之夜 (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::pair" = type { i32, i32 }
%"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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@top = external dso_local global i32, align 4
@g = external dso_local global [110 x [110 x i8]], align 16
@q = external dso_local global [12100 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z8get_hashv() #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_Z6get_idd(double noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %22, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %11
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %18
  %20 = getelementptr inbounds [110 x i8], ptr %19, i64 0, i64 0
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %20)
  br label %22

22:                                               ; preds = %16
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

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

26:                                               ; preds = %82, %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

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

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

32:                                               ; preds = %78, %31
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %32
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [110 x i8], ptr %40, i64 0, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !11
  %45 = sext i8 %44 to i32
  %46 = icmp eq i32 %45, 49
  br i1 %46, label %47, label %77

47:                                               ; preds = %37
  store i32 0, ptr @top, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %48, i32 noundef %49)
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  %50 = call noundef double @_Z8get_hashv()
  %51 = call noundef signext i8 @_Z6get_idd(double noundef %50)
  store i8 %51, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %73, %47
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr @top, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %76

57:                                               ; preds = %52
  %58 = load i8, ptr %6, align 1, !tbaa !11
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [12100 x %"struct.std::pair"], ptr @q, i64 0, i64 %60
  %62 = getelementptr inbounds %"struct.std::pair", ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !12
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %64
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [12100 x %"struct.std::pair"], ptr @q, i64 0, i64 %67
  %69 = getelementptr inbounds %"struct.std::pair", ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !14
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [110 x i8], ptr %65, i64 0, i64 %71
  store i8 %58, ptr %72, align 1, !tbaa !11
  br label %73

73:                                               ; preds = %57
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %7, align 4, !tbaa !5
  br label %52, !llvm.loop !15

76:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %77

77:                                               ; preds = %76, %37
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !5
  br label %32, !llvm.loop !16

81:                                               ; preds = %36
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !17

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

86:                                               ; preds = %98, %85
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %101

91:                                               ; preds = %86
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %93
  %95 = getelementptr inbounds [110 x i8], ptr %94, i64 0, i64 0
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %95)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %98

98:                                               ; preds = %91
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %8, align 4, !tbaa !5
  br label %86, !llvm.loop !18

101:                                              ; preds = %90
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #5

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "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 = { 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 #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 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!15 = distinct !{!15, !10}
!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 { i32, i32 }
%"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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@top = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [110 x [110 x i8]], align 16
@q = external dso_local local_unnamed_addr global [12100 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z8get_hashv() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_Z6get_idd(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge33

.preheader24:                                     ; preds = %.lr.ph
  %5 = icmp sgt i32 %10, 0
  br i1 %5, label %.preheader23.lr.ph, label %._crit_edge33

.preheader23.lr.ph:                               ; preds = %.preheader24
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.preheader23, label %.lr.ph32.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %indvars.iv
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %8)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next, %11
  br i1 %12, label %.lr.ph, label %.preheader24, !llvm.loop !9

.preheader23:                                     ; preds = %.preheader23.lr.ph, %._crit_edge
  %13 = phi i32 [ %18, %._crit_edge ], [ %10, %.preheader23.lr.ph ]
  %14 = phi i32 [ %19, %._crit_edge ], [ %6, %.preheader23.lr.ph ]
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %._crit_edge ], [ 0, %.preheader23.lr.ph ]
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph29, label %._crit_edge

.lr.ph29:                                         ; preds = %.preheader23
  %16 = trunc nuw nsw i64 %indvars.iv42 to i32
  br label %22

.preheader:                                       ; preds = %._crit_edge
  %17 = icmp sgt i32 %18, 0
  br i1 %17, label %.lr.ph32.preheader, label %._crit_edge33

.lr.ph32.preheader:                               ; preds = %.preheader23.lr.ph, %.preheader
  br label %.lr.ph32

._crit_edge.loopexit:                             ; preds = %.loopexit
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader23
  %18 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %13, %.preheader23 ]
  %19 = phi i32 [ %68, %._crit_edge.loopexit ], [ %14, %.preheader23 ]
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %20 = sext i32 %18 to i64
  %21 = icmp slt i64 %indvars.iv.next43, %20
  br i1 %21, label %.preheader23, label %.preheader, !llvm.loop !11

22:                                               ; preds = %.lr.ph29, %.loopexit
  %indvars.iv39 = phi i64 [ 0, %.lr.ph29 ], [ %indvars.iv.next40, %.loopexit ]
  %23 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %indvars.iv42, i64 %indvars.iv39
  %24 = load i8, ptr %23, align 1, !tbaa !13
  %25 = icmp eq i8 %24, 49
  br i1 %25, label %26, label %.loopexit

26:                                               ; preds = %22
  store i32 0, ptr @top, align 4, !tbaa !5
  %27 = trunc nuw nsw i64 %indvars.iv39 to i32
  tail call void @_Z3dfsii(i32 noundef %16, i32 noundef %27)
  %28 = tail call noundef double @_Z8get_hashv()
  %29 = tail call noundef signext i8 @_Z6get_idd(double noundef %28)
  %30 = load i32, ptr @top, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph27.preheader, label %.loopexit

.lr.ph27.preheader:                               ; preds = %26
  %wide.trip.count = zext nneg i32 %30 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %32 = icmp ult i32 %30, 4
  br i1 %32, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph27.preheader.new

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

.lr.ph27:                                         ; preds = %.lr.ph27, %.lr.ph27.preheader.new
  %indvars.iv36 = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %indvars.iv.next37.3, %.lr.ph27 ]
  %niter = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %niter.next.3, %.lr.ph27 ]
  %33 = getelementptr inbounds [12100 x %"struct.std::pair"], ptr @q, i64 0, i64 %indvars.iv36
  %34 = load i32, ptr %33, align 16, !tbaa !14
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %33, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %35, i64 %38
  store i8 %29, ptr %39, align 1, !tbaa !13
  %indvars.iv.next37 = or disjoint i64 %indvars.iv36, 1
  %40 = getelementptr inbounds [12100 x %"struct.std::pair"], ptr @q, i64 0, i64 %indvars.iv.next37
  %41 = load i32, ptr %40, align 8, !tbaa !14
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %40, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !16
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %42, i64 %45
  store i8 %29, ptr %46, align 1, !tbaa !13
  %indvars.iv.next37.1 = or disjoint i64 %indvars.iv36, 2
  %47 = getelementptr inbounds [12100 x %"struct.std::pair"], ptr @q, i64 0, i64 %indvars.iv.next37.1
  %48 = load i32, ptr %47, align 16, !tbaa !14
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i8, ptr %47, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !16
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %49, i64 %52
  store i8 %29, ptr %53, align 1, !tbaa !13
  %indvars.iv.next37.2 = or disjoint i64 %indvars.iv36, 3
  %54 = getelementptr inbounds [12100 x %"struct.std::pair"], ptr @q, i64 0, i64 %indvars.iv.next37.2
  %55 = load i32, ptr %54, align 8, !tbaa !14
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i8, ptr %54, i64 4
  %58 = load i32, ptr %57, align 4, !tbaa !16
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %56, i64 %59
  store i8 %29, ptr %60, align 1, !tbaa !13
  %indvars.iv.next37.3 = add nuw nsw i64 %indvars.iv36, 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 %.loopexit.loopexit.unr-lcssa, label %.lr.ph27, !llvm.loop !17

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

.lr.ph27.epil:                                    ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph27.epil
  %indvars.iv36.epil = phi i64 [ %indvars.iv.next37.epil, %.lr.ph27.epil ], [ %indvars.iv36.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph27.epil ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %61 = getelementptr inbounds [12100 x %"struct.std::pair"], ptr @q, i64 0, i64 %indvars.iv36.epil
  %62 = load i32, ptr %61, align 8, !tbaa !14
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %61, i64 4
  %65 = load i32, ptr %64, align 4, !tbaa !16
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %63, i64 %66
  store i8 %29, ptr %67, align 1, !tbaa !13
  %indvars.iv.next37.epil = add nuw nsw i64 %indvars.iv36.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 %.loopexit, label %.lr.ph27.epil, !llvm.loop !18

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph27.epil, %26, %22
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %68 = load i32, ptr @m, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next40, %69
  br i1 %70, label %22, label %._crit_edge.loopexit, !llvm.loop !20

._crit_edge33:                                    ; preds = %.lr.ph32, %0, %.preheader24, %.preheader
  ret i32 0

.lr.ph32:                                         ; preds = %.lr.ph32.preheader, %.lr.ph32
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph32 ], [ 0, %.lr.ph32.preheader ]
  %71 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %indvars.iv45
  %72 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %71)
  %73 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next46, %75
  br i1 %76, label %.lr.ph32, label %._crit_edge33, !llvm.loop !21
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) local_unnamed_addr #4

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

; 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 #0 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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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 #3 = { "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" }

!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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = !{!15, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


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