; LLVM IR from tangjz/acm-icpc :: lydsy/4961.ll (Z3dfsN8int128_t6BigIntEi)

; 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<int128_t::BigInt, std::pair<const int128_t::BigInt, int>, std::_Select1st<std::pair<const int128_t::BigInt, int>>, std::less<int128_t::BigInt>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int128_t::BigInt, std::pair<const int128_t::BigInt, int>, std::_Select1st<std::pair<const int128_t::BigInt, int>>, std::less<int128_t::BigInt>>::_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.int128_t::BigInt" = type { i64, i64 }

@tot = external dso_local global i32, align 4
@inv = external dso_local global [1290241 x i32], align 16
@sz = external dso_local global i32, align 4
@e = external dso_local global [19 x i32], align 16
@f = external dso_local global [172513 x i32], align 16
@g = external dso_local global [172513 x [19 x i32]], align 16
@Hash = external dso_local global %"class.std::map", align 8
@_ZL2pr = external hidden constant [19 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3dfsN8int128_t6BigIntEi(i64 %0, i64 %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca %"struct.int128_t::BigInt", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.int128_t::BigInt", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 0
  store i64 %0, ptr %17, align 8
  %18 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 1
  store i64 %1, ptr %18, align 8
  store i32 %2, ptr %6, align 4, !tbaa !5
  %19 = call noundef i64 @_ZNKSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %20 = icmp ne i64 %19, 0
  br i1 %20, label %21, label %24

21:                                               ; preds = %3
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %23 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %23, ptr %4, align 4
  br label %167

24:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %25 = load i32, ptr @tot, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @tot, align 4, !tbaa !5
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %5)
  store i32 %25, ptr %27, align 4, !tbaa !5
  store i32 %25, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %28 = load i32, ptr @sz, align 4, !tbaa !5
  store i32 %28, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %29 = load i32, ptr %11, align 4, !tbaa !5
  %30 = sub nsw i32 %29, 1
  store i32 %30, ptr %12, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %124, %24
  %32 = load i32, ptr %10, align 4, !tbaa !5
  %33 = load i32, ptr @sz, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %129

36:                                               ; preds = %31
  %37 = load i32, ptr %12, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = load i32, ptr %11, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp ne i32 %40, %44
  br i1 %45, label %46, label %91

46:                                               ; preds = %36
  %47 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %47, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = load i32, ptr %11, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = sdiv i32 %49, %54
  %56 = sub nsw i32 %48, %55
  store i32 %56, ptr %13, align 4, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr %59, align 4, !tbaa !5
  %62 = icmp ne i32 %61, 0
  %63 = xor i1 %62, true
  %64 = zext i1 %63 to i32
  %65 = load i32, ptr @sz, align 4, !tbaa !5
  %66 = sub nsw i32 %65, %64
  store i32 %66, ptr @sz, align 4, !tbaa !5
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [19 x i32], ptr @_ZL2pr, i64 0, i64 %68
  %70 = call { i64, i64 } @_ZNK8int128_t6BigIntdvERKi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %69)
  %71 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %72 = extractvalue { i64, i64 } %70, 0
  store i64 %72, ptr %71, align 8
  %73 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %74 = extractvalue { i64, i64 } %70, 1
  store i64 %74, ptr %73, align 8
  %75 = load i32, ptr %13, align 4, !tbaa !5
  %76 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %77 = load i64, ptr %76, align 8
  %78 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %79 = load i64, ptr %78, align 8
  %80 = call noundef i32 @_Z3dfsN8int128_t6BigIntEi(i64 %77, i64 %79, i32 noundef %75)
  store i32 %80, ptr %8, align 4, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %83, align 4, !tbaa !5
  %86 = icmp ne i32 %84, 0
  %87 = xor i1 %86, true
  %88 = zext i1 %87 to i32
  %89 = load i32, ptr @sz, align 4, !tbaa !5
  %90 = add nsw i32 %89, %88
  store i32 %90, ptr @sz, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %91

91:                                               ; preds = %46, %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = icmp eq i32 %96, 1
  %98 = zext i1 %97 to i32
  %99 = sub nsw i32 %92, %98
  store i32 %99, ptr %15, align 4, !tbaa !5
  %100 = load i32, ptr %15, align 4, !tbaa !5
  %101 = icmp slt i32 %100, 0
  br i1 %101, label %102, label %107

102:                                              ; preds = %91
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [172513 x i32], ptr @f, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  br label %115

107:                                              ; preds = %91
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [172513 x [19 x i32]], ptr @g, i64 0, i64 %109
  %111 = load i32, ptr %15, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [19 x i32], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %107, %102
  %116 = phi i32 [ %106, %102 ], [ %114, %107 ]
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %9, i32 noundef %116)
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [172513 x [19 x i32]], ptr @g, i64 0, i64 %119
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [19 x i32], ptr %120, i64 0, i64 %122
  store i32 %117, ptr %123, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %124

124:                                              ; preds = %115
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %10, align 4, !tbaa !5
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %12, align 4, !tbaa !5
  br label %31, !llvm.loop !9

129:                                              ; preds = %35
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = add nsw i32 %130, %131
  %133 = sext i32 %132 to i64
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = sub nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1290241 x i32], ptr @inv, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = mul nsw i64 %133, %139
  %141 = srem i64 %140, 1000000007
  %142 = trunc i64 %141 to i32
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [172513 x i32], ptr @f, i64 0, i64 %144
  store i32 %142, ptr %145, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %162, %129
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = load i32, ptr @sz, align 4, !tbaa !5
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %165

151:                                              ; preds = %146
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [172513 x [19 x i32]], ptr @g, i64 0, i64 %153
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [19 x i32], ptr %154, i64 0, i64 %156
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [172513 x i32], ptr @f, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %157, i32 noundef %161)
  br label %162

162:                                              ; preds = %151
  %163 = load i32, ptr %16, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %16, align 4, !tbaa !5
  br label %146, !llvm.loop !11

165:                                              ; preds = %150
  %166 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %166, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %167

167:                                              ; preds = %165, %21
  %168 = load i32, ptr %4, align 4
  ret i32 %168
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEEixERS5_(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, i64 } @_ZNK8int128_t6BigIntdvERKi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #0 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #2

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 = { 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 #3 = { 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}


; 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<int128_t::BigInt, std::pair<const int128_t::BigInt, int>, std::_Select1st<std::pair<const int128_t::BigInt, int>>, std::less<int128_t::BigInt>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int128_t::BigInt, std::pair<const int128_t::BigInt, int>, std::_Select1st<std::pair<const int128_t::BigInt, int>>, std::less<int128_t::BigInt>>::_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.int128_t::BigInt" = type { i64, i64 }

@tot = external dso_local local_unnamed_addr global i32, align 4
@inv = external dso_local local_unnamed_addr global [1290241 x i32], align 16
@sz = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local local_unnamed_addr global [19 x i32], align 16
@f = external dso_local local_unnamed_addr global [172513 x i32], align 16
@g = external dso_local global [172513 x [19 x i32]], align 16
@Hash = external dso_local global %"class.std::map", align 8
@_ZL2pr = external hidden constant [19 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3dfsN8int128_t6BigIntEi(i64 %0, i64 %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %"struct.int128_t::BigInt", align 8
  %5 = alloca i32, align 4
  store i64 %0, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %1, ptr %6, align 8
  %7 = call noundef i64 @_ZNKSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %11, label %8

8:                                                ; preds = %3
  %9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %10 = load i32, ptr %9, align 4, !tbaa !5
  br label %78

11:                                               ; preds = %3
  %12 = load i32, ptr @tot, align 4, !tbaa !5
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr @tot, align 4, !tbaa !5
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %4)
  store i32 %12, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  %15 = load i32, ptr @sz, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  %17 = sext i32 %12 to i64
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %11
  %18 = zext nneg i32 %15 to i64
  br label %33

._crit_edge.loopexit:                             ; preds = %57
  %19 = icmp sgt i32 %70, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %11, %._crit_edge.loopexit
  %20 = phi i1 [ %19, %._crit_edge.loopexit ], [ false, %11 ]
  %21 = phi i32 [ %68, %._crit_edge.loopexit ], [ 0, %11 ]
  %22 = add nsw i32 %21, %2
  %23 = sext i32 %22 to i64
  %24 = add nsw i32 %2, -1
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1290241 x i32], ptr @inv, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = mul nsw i64 %23, %28
  %30 = srem i64 %29, 1000000007
  %31 = trunc nsw i64 %30 to i32
  %32 = getelementptr inbounds [172513 x i32], ptr @f, i64 0, i64 %17
  store i32 %31, ptr %32, align 4, !tbaa !5
  br i1 %20, label %.lr.ph51, label %._crit_edge52

33:                                               ; preds = %.lr.ph, %57
  %indvars.iv53 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next54, %57 ]
  %indvars.iv = phi i64 [ %18, %.lr.ph ], [ %indvars.iv.next, %57 ]
  %34 = phi i32 [ %15, %.lr.ph ], [ %70, %57 ]
  %.03347 = phi i32 [ undef, %.lr.ph ], [ %.1, %57 ]
  %.03545 = phi i32 [ %15, %.lr.ph ], [ %.136, %57 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %35 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %indvars.iv.next
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sext i32 %.03545 to i64
  %38 = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %.not40 = icmp eq i32 %36, %39
  br i1 %.not40, label %57, label %40

40:                                               ; preds = %33
  %41 = add nsw i32 %36, 1
  %42 = sdiv i32 %2, %41
  %43 = sub nsw i32 %2, %42
  %44 = add nsw i32 %36, -1
  store i32 %44, ptr %35, align 4, !tbaa !5
  %.not41 = icmp eq i32 %44, 0
  %.neg = sext i1 %.not41 to i32
  %45 = add nsw i32 %34, %.neg
  store i32 %45, ptr @sz, align 4, !tbaa !5
  %46 = getelementptr inbounds [19 x i32], ptr @_ZL2pr, i64 0, i64 %indvars.iv.next
  %47 = call { i64, i64 } @_ZNK8int128_t6BigIntdvERKi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %46)
  %48 = extractvalue { i64, i64 } %47, 0
  %49 = extractvalue { i64, i64 } %47, 1
  %50 = call noundef i32 @_Z3dfsN8int128_t6BigIntEi(i64 %48, i64 %49, i32 noundef %43)
  %51 = load i32, ptr %35, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %35, align 4, !tbaa !5
  %.not42 = icmp eq i32 %51, 0
  %53 = zext i1 %.not42 to i32
  %54 = load i32, ptr @sz, align 4, !tbaa !5
  %55 = add nsw i32 %54, %53
  store i32 %55, ptr @sz, align 4, !tbaa !5
  %56 = trunc nsw i64 %indvars.iv.next to i32
  %sext = shl i64 %indvars.iv.next, 32
  %.pre = ashr exact i64 %sext, 32
  %.phi.trans.insert = getelementptr inbounds [19 x i32], ptr @e, i64 0, i64 %.pre
  %.pre61 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %40, %33
  %58 = phi i32 [ %.pre61, %40 ], [ %36, %33 ]
  %.136 = phi i32 [ %56, %40 ], [ %.03545, %33 ]
  %.1 = phi i32 [ %50, %40 ], [ %.03347, %33 ]
  %59 = icmp eq i32 %58, 1
  %.neg43 = sext i1 %59 to i32
  %60 = trunc nuw nsw i64 %indvars.iv53 to i32
  %61 = add i32 %60, %.neg43
  %62 = icmp slt i32 %61, 0
  %63 = sext i32 %.1 to i64
  %64 = getelementptr inbounds [172513 x i32], ptr @f, i64 0, i64 %63
  %65 = zext nneg i32 %61 to i64
  %66 = getelementptr inbounds [172513 x [19 x i32]], ptr @g, i64 0, i64 %63, i64 %65
  %.in = select i1 %62, ptr %64, ptr %66
  %67 = load i32, ptr %.in, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %67)
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = getelementptr inbounds [172513 x [19 x i32]], ptr @g, i64 0, i64 %17, i64 %indvars.iv53
  store i32 %68, ptr %69, align 4, !tbaa !5
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %70 = load i32, ptr @sz, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next54, %71
  br i1 %72, label %33, label %._crit_edge.loopexit, !llvm.loop !9

._crit_edge52:                                    ; preds = %.lr.ph51, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %78

.lr.ph51:                                         ; preds = %._crit_edge, %.lr.ph51
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.lr.ph51 ], [ 0, %._crit_edge ]
  %73 = getelementptr inbounds [172513 x [19 x i32]], ptr @g, i64 0, i64 %17, i64 %indvars.iv58
  %74 = load i32, ptr %32, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %73, i32 noundef %74)
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %75 = load i32, ptr @sz, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next59, %76
  br i1 %77, label %.lr.ph51, label %._crit_edge52, !llvm.loop !11

78:                                               ; preds = %._crit_edge52, %8
  %.032 = phi i32 [ %10, %8 ], [ %12, %._crit_edge52 ]
  ret i32 %.032
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIN8int128_t6BigIntEiSt4lessIS1_ESaISt4pairIKS1_iEEEixERS5_(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, i64 } @_ZNK8int128_t6BigIntdvERKi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #2

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 = { 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 #3 = { 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}


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