; LLVM IR from tangjz/acm-icpc :: hdu/2815.ll (Z4bsgsiii)

; 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.Node = type { i32, i32, i32 }

@e = external dso_local global [80000 x %struct.Node], align 16
@tot = external dso_local global i32, align 4
@pre = external dso_local global [960991 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3phii(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 nounwind uwtable
declare dso_local noundef i32 @_Z3powiii(i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z4bsgsiii(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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca %struct.Node, 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
  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
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = icmp eq i32 %20, 1
  br i1 %21, label %22, label %23

22:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  br label %168

23:                                               ; preds = %3
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @pre, i8 0, i64 3843964, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = sitofp i32 %24 to double
  %26 = call double @sqrt(double noundef %25) #5
  %27 = fptosi double %26 to i32
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %94, %23
  %30 = load i32, ptr %9, align 4, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %97

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  store i8 0, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %35 = load i32, ptr %10, align 4, !tbaa !5
  %36 = srem i32 %35, 960991
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %39, ptr %13, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %54, %34
  %41 = load i32, ptr %13, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  store i32 5, ptr %11, align 4
  br label %60

44:                                               ; preds = %40
  %45 = load i32, ptr %13, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %46
  %48 = getelementptr inbounds %struct.Node, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !11
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = icmp eq i32 %49, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %44
  store i8 1, ptr %12, align 1, !tbaa !9
  store i32 5, ptr %11, align 4
  br label %60

53:                                               ; preds = %44
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %13, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %56
  %58 = getelementptr inbounds %struct.Node, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !13
  store i32 %59, ptr %13, align 4, !tbaa !5
  br label %40, !llvm.loop !14

60:                                               ; preds = %52, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %61

61:                                               ; preds = %60
  %62 = load i8, ptr %12, align 1, !tbaa !9, !range !16, !noundef !17
  %63 = trunc i8 %62 to i1
  br i1 %63, label %84, label %64

64:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  %65 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 0
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = srem i32 %66, 960991
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %65, align 4, !tbaa !13
  %71 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 1
  %72 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %72, ptr %71, align 4, !tbaa !11
  %73 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 2
  %74 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %74, ptr %73, align 4, !tbaa !18
  %75 = load i32, ptr @tot, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @tot, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %77
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  %79 = load i32, ptr @tot, align 4, !tbaa !5
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = srem i32 %80, 960991
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %82
  store i32 %79, ptr %83, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %64, %61
  %85 = load i32, ptr %10, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = mul nsw i64 %86, %88
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = srem i64 %89, %91
  %93 = trunc i64 %92 to i32
  store i32 %93, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  br label %94

94:                                               ; preds = %84
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %9, align 4, !tbaa !5
  br label %29, !llvm.loop !20

97:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = call noundef i32 @_Z3phii(i32 noundef %98)
  store i32 %99, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %100, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = load i32, ptr %15, align 4, !tbaa !5
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = load i32, ptr %15, align 4, !tbaa !5
  %105 = srem i32 %103, %104
  %106 = sub nsw i32 %102, %105
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = call noundef i32 @_Z3powiii(i32 noundef %101, i32 noundef %106, i32 noundef %107)
  store i32 %108, ptr %18, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %161, %97
  %110 = load i32, ptr %16, align 4, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 8, ptr %11, align 4
  br label %164

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %115 = load i32, ptr %17, align 4, !tbaa !5
  %116 = srem i32 %115, 960991
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  store i32 %119, ptr %19, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %143, %114
  %121 = load i32, ptr %19, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %124, label %123

123:                                              ; preds = %120
  store i32 11, ptr %11, align 4
  br label %149

124:                                              ; preds = %120
  %125 = load i32, ptr %19, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %126
  %128 = getelementptr inbounds %struct.Node, ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !11
  %130 = load i32, ptr %17, align 4, !tbaa !5
  %131 = icmp eq i32 %129, %130
  br i1 %131, label %132, label %142

132:                                              ; preds = %124
  %133 = load i32, ptr %16, align 4, !tbaa !5
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = mul nsw i32 %133, %134
  %136 = load i32, ptr %19, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.Node, ptr %138, i32 0, i32 2
  %140 = load i32, ptr %139, align 4, !tbaa !18
  %141 = add nsw i32 %135, %140
  store i32 %141, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %149

142:                                              ; preds = %124
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %19, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.Node, ptr %146, i32 0, i32 0
  %148 = load i32, ptr %147, align 4, !tbaa !13
  store i32 %148, ptr %19, align 4, !tbaa !5
  br label %120, !llvm.loop !21

149:                                              ; preds = %132, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  %150 = load i32, ptr %11, align 4
  switch i32 %150, label %164 [
    i32 11, label %151
  ]

151:                                              ; preds = %149
  %152 = load i32, ptr %17, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = load i32, ptr %18, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = mul nsw i64 %153, %155
  %157 = load i32, ptr %7, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = srem i64 %156, %158
  %160 = trunc i64 %159 to i32
  store i32 %160, ptr %17, align 4, !tbaa !5
  br label %161

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

164:                                              ; preds = %149, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %165 = load i32, ptr %11, align 4
  switch i32 %165, label %167 [
    i32 8, label %166
  ]

166:                                              ; preds = %164
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %167

167:                                              ; preds = %166, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %168

168:                                              ; preds = %167, %22
  %169 = load i32, ptr %4, align 4
  ret i32 %169
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !6, i64 8}
!19 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}


; 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.Node = type { i32, i32, i32 }

@e = external dso_local local_unnamed_addr global [80000 x %struct.Node], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global [960991 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3phii(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z4bsgsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq i32 %2, 1
  br i1 %4, label %.loopexit, label %5

5:                                                ; preds = %3
  store i32 0, ptr @tot, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3843964) @pre, i8 0, i64 3843964, i1 false)
  %6 = sitofp i32 %2 to double
  %7 = tail call double @sqrt(double noundef %6) #3
  %8 = fptosi double %7 to i32
  %9 = add i32 %8, 1
  %.not61 = icmp slt i32 %8, 0
  br i1 %.not61, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %10 = sext i32 %0 to i64
  %11 = sext i32 %2 to i64
  br label %18

._crit_edge:                                      ; preds = %.loopexit59, %5
  %12 = tail call noundef i32 @_Z3phii(i32 noundef %2)
  %13 = srem i32 %9, %12
  %14 = sub nsw i32 %12, %13
  %15 = tail call noundef i32 @_Z3powiii(i32 noundef %0, i32 noundef %14, i32 noundef %2)
  br i1 %.not61, label %.loopexit, label %.lr.ph68

.lr.ph68:                                         ; preds = %._crit_edge
  %16 = sext i32 %15 to i64
  %17 = sext i32 %2 to i64
  br label %40

18:                                               ; preds = %.lr.ph, %.loopexit59
  %.04663 = phi i32 [ 0, %.lr.ph ], [ %39, %.loopexit59 ]
  %.04762 = phi i32 [ 1, %.lr.ph ], [ %38, %.loopexit59 ]
  %19 = phi i32 [ %tot.promoted, %.lr.ph ], [ %34, %.loopexit59 ]
  %20 = srem i32 %.04762, 960991
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %21
  br label %23

23:                                               ; preds = %24, %18
  %.051.in = phi ptr [ %22, %18 ], [ %26, %24 ]
  %.051 = load i32, ptr %.051.in, align 4, !tbaa !5
  %.not56.not = icmp eq i32 %.051, 0
  br i1 %.not56.not, label %.critedge, label %24

24:                                               ; preds = %23
  %25 = sext i32 %.051 to i64
  %26 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = icmp eq i32 %28, %.04762
  br i1 %29, label %.loopexit59, label %23, !llvm.loop !11

.critedge:                                        ; preds = %23
  %30 = load i32, ptr %22, align 4, !tbaa !5
  %31 = add nsw i32 %19, 1
  store i32 %31, ptr @tot, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %33, i64 4
  store i32 %.04762, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %33, i64 8
  store i32 %.04663, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  store i32 %31, ptr %22, align 4, !tbaa !5
  br label %.loopexit59

.loopexit59:                                      ; preds = %24, %.critedge
  %34 = phi i32 [ %31, %.critedge ], [ %19, %24 ]
  %35 = sext i32 %.04762 to i64
  %36 = mul nsw i64 %35, %10
  %37 = srem i64 %36, %11
  %38 = trunc nsw i64 %37 to i32
  %39 = add nuw i32 %.04663, 1
  %exitcond.not = icmp eq i32 %.04663, %8
  br i1 %exitcond.not, label %._crit_edge, label %18, !llvm.loop !13

40:                                               ; preds = %.lr.ph68, %56
  %.04466 = phi i32 [ %1, %.lr.ph68 ], [ %60, %56 ]
  %.04565 = phi i32 [ 0, %.lr.ph68 ], [ %61, %56 ]
  %41 = srem i32 %.04466, 960991
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %42
  br label %44

44:                                               ; preds = %45, %40
  %.0.in = phi ptr [ %43, %40 ], [ %47, %45 ]
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !5
  %.not55 = icmp eq i32 %.0, 0
  br i1 %.not55, label %56, label %45

45:                                               ; preds = %44
  %46 = sext i32 %.0 to i64
  %47 = getelementptr inbounds [80000 x %struct.Node], ptr @e, i64 0, i64 %46
  %48 = getelementptr inbounds i8, ptr %47, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = icmp eq i32 %49, %.04466
  br i1 %50, label %51, label %44, !llvm.loop !14

51:                                               ; preds = %45
  %52 = mul nuw nsw i32 %.04565, %9
  %53 = getelementptr inbounds i8, ptr %47, i64 8
  %54 = load i32, ptr %53, align 4, !tbaa !15
  %55 = add nsw i32 %54, %52
  br label %.loopexit

56:                                               ; preds = %44
  %57 = sext i32 %.04466 to i64
  %58 = mul nsw i64 %57, %16
  %59 = srem i64 %58, %17
  %60 = trunc nsw i64 %59 to i32
  %61 = add nuw i32 %.04565, 1
  %exitcond70.not = icmp eq i32 %.04565, %8
  br i1 %exitcond70.not, label %.loopexit, label %40, !llvm.loop !16

.loopexit:                                        ; preds = %56, %._crit_edge, %51, %3
  %.4 = phi i32 [ 0, %3 ], [ %55, %51 ], [ -1, %._crit_edge ], [ -1, %56 ]
  ret i32 %.4
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "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 = !{!10, !6, i64 4}
!10 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!10, !6, i64 8}
!16 = distinct !{!16, !12}


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