; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 2/1152. False Mirrors.ll (Z3dfsiii)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, int>, std::_Select1st<std::pair<const std::pair<long long, long long>, int>>, std::less<std::pair<long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, int>, std::_Select1st<std::pair<const std::pair<long long, long long>, int>>, std::less<std::pair<long long, 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 }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global [20 x i32], align 16
@mp = external dso_local global %"class.std::map", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %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 %"struct.std::pair.0", align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair.0", align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair.0", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair", align 8
  %24 = alloca %"struct.std::pair.0", align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %25 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %25, ptr %9, align 4
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %26 = call noundef i64 @_ZNKSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %8)
  %27 = icmp ne i64 %26, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  br i1 %27, label %28, label %32

28:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %29 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %29, ptr %11, align 4
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #4
  br label %146

32:                                               ; preds = %3
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %38

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %36 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %36, ptr %13, align 4
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %12)
  store i32 0, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  store i32 0, ptr %4, align 4
  br label %146

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 10000000, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %138, %38
  %40 = load i32, ptr %15, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %141

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %45 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %45, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %46 = load i32, ptr %15, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = srem i32 %47, %48
  store i32 %49, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %50 = load i32, ptr %15, align 4, !tbaa !5
  %51 = add nsw i32 %50, 2
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = srem i32 %51, %52
  store i32 %53, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %54 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %54, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %55 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %55, ptr %21, align 4, !tbaa !5
  %56 = load i32, ptr %21, align 4, !tbaa !5
  %57 = load i32, ptr %17, align 4, !tbaa !5
  %58 = shl i32 1, %57
  %59 = and i32 %56, %58
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %74

61:                                               ; preds = %44
  %62 = load i32, ptr %21, align 4, !tbaa !5
  %63 = load i32, ptr %18, align 4, !tbaa !5
  %64 = shl i32 1, %63
  %65 = and i32 %62, %64
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %74

67:                                               ; preds = %61
  %68 = load i32, ptr %21, align 4, !tbaa !5
  %69 = load i32, ptr %19, align 4, !tbaa !5
  %70 = shl i32 1, %69
  %71 = and i32 %68, %70
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %67
  store i32 4, ptr %16, align 4
  br label %135

74:                                               ; preds = %67, %61, %44
  %75 = load i32, ptr %21, align 4, !tbaa !5
  %76 = load i32, ptr %17, align 4, !tbaa !5
  %77 = shl i32 1, %76
  %78 = and i32 %75, %77
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %87

80:                                               ; preds = %74
  %81 = load i32, ptr %17, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [20 x i32], ptr @m, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %20, align 4, !tbaa !5
  %86 = sub nsw i32 %85, %84
  store i32 %86, ptr %20, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %80, %74
  %88 = load i32, ptr %21, align 4, !tbaa !5
  %89 = load i32, ptr %18, align 4, !tbaa !5
  %90 = shl i32 1, %89
  %91 = and i32 %88, %90
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %100

93:                                               ; preds = %87
  %94 = load i32, ptr %18, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [20 x i32], ptr @m, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr %20, align 4, !tbaa !5
  %99 = sub nsw i32 %98, %97
  store i32 %99, ptr %20, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %93, %87
  %101 = load i32, ptr %21, align 4, !tbaa !5
  %102 = load i32, ptr %19, align 4, !tbaa !5
  %103 = shl i32 1, %102
  %104 = and i32 %101, %103
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %113

106:                                              ; preds = %100
  %107 = load i32, ptr %19, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [20 x i32], ptr @m, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %20, align 4, !tbaa !5
  %112 = sub nsw i32 %111, %110
  store i32 %112, ptr %20, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %106, %100
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = shl i32 1, %114
  %116 = load i32, ptr %21, align 4, !tbaa !5
  %117 = or i32 %116, %115
  store i32 %117, ptr %21, align 4, !tbaa !5
  %118 = load i32, ptr %18, align 4, !tbaa !5
  %119 = shl i32 1, %118
  %120 = load i32, ptr %21, align 4, !tbaa !5
  %121 = or i32 %120, %119
  store i32 %121, ptr %21, align 4, !tbaa !5
  %122 = load i32, ptr %19, align 4, !tbaa !5
  %123 = shl i32 1, %122
  %124 = load i32, ptr %21, align 4, !tbaa !5
  %125 = or i32 %124, %123
  store i32 %125, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %126 = load i32, ptr %20, align 4, !tbaa !5
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  %129 = load i32, ptr %21, align 4, !tbaa !5
  %130 = load i32, ptr %20, align 4, !tbaa !5
  %131 = call noundef i32 @_Z3dfsiii(i32 noundef %128, i32 noundef %129, i32 noundef %130)
  %132 = add nsw i32 %126, %131
  store i32 %132, ptr %22, align 4, !tbaa !5
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %134 = load i32, ptr %133, align 4, !tbaa !5
  store i32 %134, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  store i32 0, ptr %16, align 4
  br label %135

135:                                              ; preds = %113, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %136 = load i32, ptr %16, align 4
  switch i32 %136, label %148 [
    i32 0, label %137
    i32 4, label %138
  ]

137:                                              ; preds = %135
  br label %138

138:                                              ; preds = %137, %135
  %139 = load i32, ptr %15, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %15, align 4, !tbaa !5
  br label %39, !llvm.loop !9

141:                                              ; preds = %43
  %142 = load i32, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %143 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %143, ptr %24, align 4
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(8) %24)
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %23)
  store i32 %142, ptr %144, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #4
  %145 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %145, ptr %4, align 4
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %146

146:                                              ; preds = %141, %35, %28
  %147 = load i32, ptr %4, align 4
  ret i32 %147

148:                                              ; preds = %135
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

; 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 nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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 = { inlinehint 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 = { 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"}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, int>, std::_Select1st<std::pair<const std::pair<long long, long long>, int>>, std::less<std::pair<long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, int>, std::_Select1st<std::pair<const std::pair<long long, long long>, int>>, std::less<std::pair<long long, 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 }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type { i32, i32 }

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global [20 x i32], align 16
@mp = external dso_local global %"class.std::map", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair.0", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair.0", align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair.0", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair.0", align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %16 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %16, ptr %7, align 8
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %17 = call noundef i64 @_ZNKSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %.not = icmp eq i64 %17, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br i1 %.not, label %22, label %18

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %19 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %19, ptr %9, align 8
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %8)
  %21 = load i32, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  br label %83

22:                                               ; preds = %3
  %23 = icmp eq i32 %2, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %25 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %25, ptr %11, align 8
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %10)
  store i32 0, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  br label %83

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  store i32 10000000, ptr %12, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %78, %27
  %30 = phi i32 [ 10000000, %27 ], [ %79, %78 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  %31 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %31, ptr %15, align 8
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(8) %15)
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(16) %14)
  store i32 %30, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #4
  %33 = load i32, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  br label %83

.lr.ph:                                           ; preds = %27, %78
  %34 = phi i32 [ %79, %78 ], [ 10000000, %27 ]
  %35 = phi i32 [ %80, %78 ], [ %28, %27 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %78 ], [ 0, %27 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = trunc nuw nsw i64 %indvars.iv.next to i32
  %37 = srem i32 %36, %35
  %38 = trunc i64 %indvars.iv to i32
  %39 = add i32 %38, 2
  %40 = srem i32 %39, %35
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = trunc nuw nsw i64 %indvars.iv to i32
  %43 = shl nuw i32 1, %42
  %44 = and i32 %41, %43
  %cond = icmp eq i32 %44, 0
  br i1 %cond, label %51, label %45

45:                                               ; preds = %.lr.ph
  %46 = shl nuw i32 1, %37
  %47 = and i32 %41, %46
  %.not40 = icmp eq i32 %47, 0
  br i1 %.not40, label %.thread, label %48

48:                                               ; preds = %45
  %49 = shl nuw i32 1, %40
  %50 = and i32 %41, %49
  %.not41 = icmp eq i32 %50, 0
  br i1 %.not41, label %.thread53, label %78

51:                                               ; preds = %.lr.ph
  %52 = getelementptr inbounds [20 x i32], ptr @m, i64 0, i64 %indvars.iv
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sub nsw i32 %2, %53
  %.pre44 = shl nuw i32 1, %37
  %.pre45 = and i32 %41, %.pre44
  %55 = icmp eq i32 %.pre45, 0
  br i1 %55, label %.thread, label %.thread53

.thread:                                          ; preds = %45, %51
  %.052 = phi i32 [ %54, %51 ], [ %2, %45 ]
  %.pre-phi51 = phi i32 [ %.pre44, %51 ], [ %46, %45 ]
  %56 = zext nneg i32 %37 to i64
  %57 = getelementptr inbounds [20 x i32], ptr @m, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sub nsw i32 %.052, %58
  br label %.thread53

.thread53:                                        ; preds = %48, %.thread, %51
  %.pre-phi50 = phi i32 [ %.pre-phi51, %.thread ], [ %.pre44, %51 ], [ %46, %48 ]
  %.1 = phi i32 [ %59, %.thread ], [ %54, %51 ], [ %2, %48 ]
  %60 = shl nuw i32 1, %40
  %61 = and i32 %41, %60
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %68

63:                                               ; preds = %.thread53
  %64 = zext nneg i32 %40 to i64
  %65 = getelementptr inbounds [20 x i32], ptr @m, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sub nsw i32 %.1, %66
  br label %68

68:                                               ; preds = %63, %.thread53
  %.2 = phi i32 [ %67, %63 ], [ %.1, %.thread53 ]
  %69 = or i32 %.pre-phi50, %43
  %70 = or i32 %69, %41
  %71 = or i32 %70, %60
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  %74 = call noundef i32 @_Z3dfsiii(i32 noundef %73, i32 noundef %71, i32 noundef %.2)
  %75 = add nsw i32 %74, %.2
  store i32 %75, ptr %13, align 4, !tbaa !5
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %48, %68
  %79 = phi i32 [ %34, %48 ], [ %77, %68 ]
  %80 = phi i32 [ %35, %48 ], [ %.pre, %68 ]
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next, %81
  br i1 %82, label %.lr.ph, label %._crit_edge, !llvm.loop !9

83:                                               ; preds = %._crit_edge, %24, %18
  %.035 = phi i32 [ %21, %18 ], [ 0, %24 ], [ %33, %._crit_edge ]
  ret i32 %.035
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress 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 nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt4pairIxxEiSt4lessIS1_ESaIS0_IKS1_iEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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 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 = { inlinehint 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 = { 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"}


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