; LLVM IR from tangjz/acm-icpc :: hdu/6037.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"

%struct.HashTable = type { i32, %"class.std::unordered_map" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%struct.FracExp = type { i32, [19 x i32] }
%"struct.int128_t::BigInt" = type { i64, i64 }

@Hash = external dso_local global %struct.HashTable, align 8
@cur = external dso_local global %struct.FracExp, align 4
@f = external dso_local global [172513 x double], align 16
@g = external dso_local global [172513 x [19 x double]], align 16
@_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 double, align 8
  %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 zeroext i1 @_ZNK9HashTable5countERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %5)
  br i1 %19, label %20, label %22

20:                                               ; preds = %3
  %21 = call noundef i32 @_ZNK9HashTable5getIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %5)
  store i32 %21, ptr %4, align 4
  br label %161

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  %23 = call noundef i32 @_ZN9HashTable5newIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %5)
  store i32 %23, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %24 = load i32, ptr @cur, align 4, !tbaa !11
  store i32 %24, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %25 = load i32, ptr %11, align 4, !tbaa !5
  %26 = sub nsw i32 %25, 1
  store i32 %26, ptr %12, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %121, %22
  %28 = load i32, ptr %10, align 4, !tbaa !5
  %29 = load i32, ptr @cur, align 4, !tbaa !11
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = load i32, ptr %12, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (%struct.FracExp, ptr @cur, i32 0, i32 1), i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %11, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (%struct.FracExp, ptr @cur, i32 0, i32 1), i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp ne i32 %36, %40
  br i1 %41, label %42, label %87

42:                                               ; preds = %32
  %43 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %43, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = load i32, ptr %11, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (%struct.FracExp, ptr @cur, i32 0, i32 1), i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  %51 = sdiv i32 %45, %50
  %52 = sub nsw i32 %44, %51
  store i32 %52, ptr %13, align 4, !tbaa !5
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (%struct.FracExp, ptr @cur, i32 0, i32 1), i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %55, align 4, !tbaa !5
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %62, label %59

59:                                               ; preds = %42
  %60 = load i32, ptr @cur, align 4, !tbaa !11
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr @cur, align 4, !tbaa !11
  br label %62

62:                                               ; preds = %59, %42
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [19 x i32], ptr @_ZL2pr, i64 0, i64 %64
  %66 = call { i64, i64 } @_ZNK8int128_t6BigIntdvERKi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %65)
  %67 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %68 = extractvalue { i64, i64 } %66, 0
  store i64 %68, ptr %67, align 8
  %69 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %70 = extractvalue { i64, i64 } %66, 1
  store i64 %70, ptr %69, align 8
  %71 = load i32, ptr %13, align 4, !tbaa !5
  %72 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %73 = load i64, ptr %72, align 8
  %74 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %75 = load i64, ptr %74, align 8
  %76 = call noundef i32 @_Z3dfsN8int128_t6BigIntEi(i64 %73, i64 %75, i32 noundef %71)
  store i32 %76, ptr %8, align 4, !tbaa !5
  %77 = load i32, ptr %11, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (%struct.FracExp, ptr @cur, i32 0, i32 1), i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %79, align 4, !tbaa !5
  %82 = icmp ne i32 %80, 0
  br i1 %82, label %86, label %83

83:                                               ; preds = %62
  %84 = load i32, ptr @cur, align 4, !tbaa !11
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr @cur, align 4, !tbaa !11
  br label %86

86:                                               ; preds = %83, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  br label %87

87:                                               ; preds = %86, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (%struct.FracExp, ptr @cur, i32 0, i32 1), i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp eq i32 %92, 1
  %94 = zext i1 %93 to i32
  %95 = sub nsw i32 %88, %94
  store i32 %95, ptr %15, align 4, !tbaa !5
  %96 = load i32, ptr %15, align 4, !tbaa !5
  %97 = icmp slt i32 %96, 0
  br i1 %97, label %98, label %103

98:                                               ; preds = %87
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [172513 x double], ptr @f, i64 0, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !9
  br label %111

103:                                              ; preds = %87
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [172513 x [19 x double]], ptr @g, i64 0, i64 %105
  %107 = load i32, ptr %15, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [19 x double], ptr %106, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !9
  br label %111

111:                                              ; preds = %103, %98
  %112 = phi double [ %102, %98 ], [ %110, %103 ]
  %113 = load double, ptr %9, align 8, !tbaa !9
  %114 = fadd double %113, %112
  store double %114, ptr %9, align 8, !tbaa !9
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [172513 x [19 x double]], ptr @g, i64 0, i64 %116
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [19 x double], ptr %117, i64 0, i64 %119
  store double %114, ptr %120, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  br label %121

121:                                              ; preds = %111
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %10, align 4, !tbaa !5
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = add nsw i32 %124, -1
  store i32 %125, ptr %12, align 4, !tbaa !5
  br label %27, !llvm.loop !13

126:                                              ; preds = %31
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sitofp i32 %127 to double
  %129 = load double, ptr %9, align 8, !tbaa !9
  %130 = fadd double %128, %129
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = sub nsw i32 %131, 1
  %133 = sitofp i32 %132 to double
  %134 = fdiv double %130, %133
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [172513 x double], ptr @f, i64 0, i64 %136
  store double %134, ptr %137, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #2
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %156, %126
  %139 = load i32, ptr %16, align 4, !tbaa !5
  %140 = load i32, ptr @cur, align 4, !tbaa !11
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #2
  br label %159

143:                                              ; preds = %138
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [172513 x double], ptr @f, i64 0, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !9
  %148 = load i32, ptr %7, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [172513 x [19 x double]], ptr @g, i64 0, i64 %149
  %151 = load i32, ptr %16, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [19 x double], ptr %150, i64 0, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !9
  %155 = fadd double %154, %147
  store double %155, ptr %153, align 8, !tbaa !9
  br label %156

156:                                              ; preds = %143
  %157 = load i32, ptr %16, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %16, align 4, !tbaa !5
  br label %138, !llvm.loop !15

159:                                              ; preds = %142
  %160 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %160, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  br label %161

161:                                              ; preds = %159, %20
  %162 = load i32, ptr %4, align 4
  ret i32 %162
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK9HashTable5countERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9HashTable5getIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64), 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 noundef i32 @_ZN9HashTable5newIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; 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

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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS7FracExp", !6, i64 0, !7, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.HashTable = type { i32, %"class.std::unordered_map" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%struct.FracExp = type { i32, [19 x i32] }
%"struct.int128_t::BigInt" = type { i64, i64 }

@Hash = external dso_local global %struct.HashTable, align 8
@cur = external dso_local local_unnamed_addr global %struct.FracExp, align 4
@f = external dso_local local_unnamed_addr global [172513 x double], align 16
@g = external dso_local local_unnamed_addr global [172513 x [19 x double]], align 16
@_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
  store i64 %0, ptr %4, align 8
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %1, ptr %5, align 8
  %6 = call noundef zeroext i1 @_ZNK9HashTable5countERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %4)
  br i1 %6, label %7, label %9

7:                                                ; preds = %3
  %8 = call noundef i32 @_ZNK9HashTable5getIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %4)
  br label %.loopexit

9:                                                ; preds = %3
  %10 = call noundef i32 @_ZN9HashTable5newIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64) @Hash, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %11 = load i32, ptr @cur, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  %13 = sext i32 %10 to i64
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9
  %14 = zext nneg i32 %11 to i64
  %.phi.trans.insert = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (i8, ptr @cur, i64 4), i64 0, i64 %14
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !10
  br label %27

._crit_edge:                                      ; preds = %51, %9
  %.035.lcssa = phi double [ 0.000000e+00, %9 ], [ %65, %51 ]
  %.lcssa = phi i32 [ %11, %9 ], [ %52, %51 ]
  %15 = sitofp i32 %2 to double
  %16 = fadd double %.035.lcssa, %15
  %17 = add nsw i32 %2, -1
  %18 = sitofp i32 %17 to double
  %19 = fdiv double %16, %18
  %20 = getelementptr inbounds [172513 x double], ptr @f, i64 0, i64 %13
  store double %19, ptr %20, align 8, !tbaa !11
  %21 = icmp sgt i32 %.lcssa, 0
  br i1 %21, label %.lr.ph53.preheader, label %.loopexit

.lr.ph53.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  %min.iters.check = icmp ult i32 %.lcssa, 4
  br i1 %min.iters.check, label %.lr.ph53.preheader71, label %vector.ph

.lr.ph53.preheader71:                             ; preds = %middle.block, %.lr.ph53.preheader
  %indvars.iv61.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph53

vector.ph:                                        ; preds = %.lr.ph53.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %19, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %22 = getelementptr inbounds [172513 x [19 x double]], ptr @g, i64 0, i64 %13, i64 %index
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %wide.load = load <2 x double>, ptr %22, align 8, !tbaa !11
  %wide.load70 = load <2 x double>, ptr %23, align 8, !tbaa !11
  %24 = fadd <2 x double> %broadcast.splat, %wide.load
  %25 = fadd <2 x double> %broadcast.splat, %wide.load70
  store <2 x double> %24, ptr %22, align 8, !tbaa !11
  store <2 x double> %25, ptr %23, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %26 = icmp eq i64 %index.next, %n.vec
  br i1 %26, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %.lr.ph53.preheader71

27:                                               ; preds = %.lr.ph, %51
  %28 = phi i32 [ %11, %.lr.ph ], [ %52, %51 ]
  %29 = phi i32 [ %.pre, %.lr.ph ], [ %55, %51 ]
  %indvars.iv56 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next57, %51 ]
  %indvars.iv = phi i64 [ %14, %.lr.ph ], [ %indvars.iv.next, %51 ]
  %.03448 = phi i32 [ undef, %.lr.ph ], [ %.1, %51 ]
  %.03547 = phi double [ 0.000000e+00, %.lr.ph ], [ %65, %51 ]
  %.03845 = phi i32 [ %11, %.lr.ph ], [ %.139, %51 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %30 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (i8, ptr @cur, i64 4), i64 0, i64 %indvars.iv.next
  %31 = load i32, ptr %30, align 4, !tbaa !10
  %.not = icmp eq i32 %31, %29
  br i1 %.not, label %51, label %32

32:                                               ; preds = %27
  %33 = add nsw i32 %31, 1
  %34 = sdiv i32 %2, %33
  %35 = sub nsw i32 %2, %34
  %36 = add nsw i32 %31, -1
  store i32 %36, ptr %30, align 4, !tbaa !10
  %.not42 = icmp eq i32 %36, 0
  br i1 %.not42, label %37, label %40

37:                                               ; preds = %32
  %38 = load i32, ptr @cur, align 4, !tbaa !5
  %39 = add nsw i32 %38, -1
  store i32 %39, ptr @cur, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %37, %32
  %41 = getelementptr inbounds [19 x i32], ptr @_ZL2pr, i64 0, i64 %indvars.iv.next
  %42 = call { i64, i64 } @_ZNK8int128_t6BigIntdvERKi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = extractvalue { i64, i64 } %42, 0
  %44 = extractvalue { i64, i64 } %42, 1
  %45 = call noundef i32 @_Z3dfsN8int128_t6BigIntEi(i64 %43, i64 %44, i32 noundef %35)
  %46 = load i32, ptr %30, align 4, !tbaa !10
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %30, align 4, !tbaa !10
  %.not43 = icmp eq i32 %46, 0
  %48 = trunc nsw i64 %indvars.iv.next to i32
  %.pre64 = load i32, ptr @cur, align 4, !tbaa !5
  br i1 %.not43, label %49, label %51

49:                                               ; preds = %40
  %50 = add nsw i32 %.pre64, 1
  store i32 %50, ptr @cur, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %40, %49, %27
  %52 = phi i32 [ %28, %27 ], [ %50, %49 ], [ %.pre64, %40 ]
  %.139 = phi i32 [ %.03845, %27 ], [ %48, %49 ], [ %48, %40 ]
  %.1 = phi i32 [ %.03448, %27 ], [ %45, %49 ], [ %45, %40 ]
  %53 = sext i32 %.139 to i64
  %54 = getelementptr inbounds [19 x i32], ptr getelementptr inbounds (i8, ptr @cur, i64 4), i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !10
  %56 = icmp eq i32 %55, 1
  %.neg = sext i1 %56 to i32
  %57 = trunc nuw nsw i64 %indvars.iv56 to i32
  %58 = add i32 %57, %.neg
  %59 = icmp slt i32 %58, 0
  %60 = sext i32 %.1 to i64
  %61 = getelementptr inbounds [172513 x double], ptr @f, i64 0, i64 %60
  %62 = zext nneg i32 %58 to i64
  %63 = getelementptr inbounds [172513 x [19 x double]], ptr @g, i64 0, i64 %60, i64 %62
  %.in = select i1 %59, ptr %61, ptr %63
  %64 = load double, ptr %.in, align 8, !tbaa !11
  %65 = fadd double %.03547, %64
  %66 = getelementptr inbounds [172513 x [19 x double]], ptr @g, i64 0, i64 %13, i64 %indvars.iv56
  store double %65, ptr %66, align 8, !tbaa !11
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %67 = sext i32 %52 to i64
  %68 = icmp slt i64 %indvars.iv.next57, %67
  br i1 %68, label %27, label %._crit_edge, !llvm.loop !17

.lr.ph53:                                         ; preds = %.lr.ph53.preheader71, %.lr.ph53
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph53 ], [ %indvars.iv61.ph, %.lr.ph53.preheader71 ]
  %69 = getelementptr inbounds [172513 x [19 x double]], ptr @g, i64 0, i64 %13, i64 %indvars.iv61
  %70 = load double, ptr %69, align 8, !tbaa !11
  %71 = fadd double %19, %70
  store double %71, ptr %69, align 8, !tbaa !11
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph53, !llvm.loop !18

.loopexit:                                        ; preds = %.lr.ph53, %middle.block, %._crit_edge, %7
  %.033 = phi i32 [ %8, %7 ], [ %10, %._crit_edge ], [ %10, %middle.block ], [ %10, %.lr.ph53 ]
  ret i32 %.033
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK9HashTable5countERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9HashTable5getIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9HashTable5newIDERKN8int128_t6BigIntE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; 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

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

!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, !7, i64 0}
!6 = !{!"_ZTS7FracExp", !7, i64 0, !8, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14, !16, !15}


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