; LLVM IR from tangjz/acm-icpc :: self_training/2015-02-09/M.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 [32000 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 uwtable
declare dso_local noundef i32 @_Z3invii(i32 noundef, i32 noundef) #0

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

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

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

; Function Attrs: mustprogress 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
  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
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %22

21:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  br label %163

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

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

32:                                               ; preds = %28
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %96

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

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

42:                                               ; preds = %39
  store i32 5, ptr %11, align 4
  br label %59

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

51:                                               ; preds = %43
  store i8 1, ptr %12, align 1, !tbaa !9
  store i32 5, ptr %11, align 4
  br label %59

52:                                               ; preds = %43
  br label %53

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

59:                                               ; preds = %51, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %60

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

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

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

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

96:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %97 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %97, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = call noundef i32 @_Z3powiii(i32 noundef %98, i32 noundef %99, i32 noundef %100)
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = call noundef i32 @_Z3invii(i32 noundef %101, i32 noundef %102)
  store i32 %103, ptr %17, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %156, %96
  %105 = load i32, ptr %15, align 4, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  store i32 8, ptr %11, align 4
  br label %159

109:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %110 = load i32, ptr %16, align 4, !tbaa !5
  %111 = srem i32 %110, 960991
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  store i32 %114, ptr %18, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %138, %109
  %116 = load i32, ptr %18, align 4, !tbaa !5
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 11, ptr %11, align 4
  br label %144

119:                                              ; preds = %115
  %120 = load i32, ptr %18, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.Node, ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !11
  %125 = load i32, ptr %16, align 4, !tbaa !5
  %126 = icmp eq i32 %124, %125
  br i1 %126, label %127, label %137

127:                                              ; preds = %119
  %128 = load i32, ptr %15, align 4, !tbaa !5
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = mul nsw i32 %128, %129
  %131 = load i32, ptr %18, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.Node, ptr %133, i32 0, i32 2
  %135 = load i32, ptr %134, align 4, !tbaa !18
  %136 = add nsw i32 %130, %135
  store i32 %136, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %144

137:                                              ; preds = %119
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %18, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %140
  %142 = getelementptr inbounds %struct.Node, ptr %141, i32 0, i32 0
  %143 = load i32, ptr %142, align 4, !tbaa !13
  store i32 %143, ptr %18, align 4, !tbaa !5
  br label %115, !llvm.loop !21

144:                                              ; preds = %127, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %145 = load i32, ptr %11, align 4
  switch i32 %145, label %159 [
    i32 11, label %146
  ]

146:                                              ; preds = %144
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = mul nsw i64 %148, %150
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = srem i64 %151, %153
  %155 = trunc i64 %154 to i32
  store i32 %155, ptr %16, align 4, !tbaa !5
  br label %156

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

159:                                              ; preds = %144, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %160 = load i32, ptr %11, align 4
  switch i32 %160, label %162 [
    i32 8, label %161
  ]

161:                                              ; preds = %159
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %162

162:                                              ; preds = %161, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %163

163:                                              ; preds = %162, %21
  %164 = load i32, ptr %4, align 4
  ret i32 %164
}

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

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

; 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) #5

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!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 [32000 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 uwtable
declare dso_local noundef i32 @_Z3invii(i32 noundef, 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 #1

; Function Attrs: mustprogress 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(384000) @e, i8 0, i64 384000, i1 false)
  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) #4
  %8 = fptosi double %7 to i32
  %9 = add i32 %8, 1
  %.not59 = icmp slt i32 %8, 0
  br i1 %.not59, 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 %16

._crit_edge:                                      ; preds = %.loopexit57, %5
  %12 = tail call noundef i32 @_Z3powiii(i32 noundef %0, i32 noundef %9, i32 noundef %2)
  %13 = tail call noundef i32 @_Z3invii(i32 noundef %12, i32 noundef %2)
  br i1 %.not59, label %.loopexit, label %.lr.ph66

.lr.ph66:                                         ; preds = %._crit_edge
  %14 = sext i32 %13 to i64
  %15 = sext i32 %2 to i64
  br label %38

16:                                               ; preds = %.lr.ph, %.loopexit57
  %.04461 = phi i32 [ 0, %.lr.ph ], [ %37, %.loopexit57 ]
  %.04560 = phi i32 [ 1, %.lr.ph ], [ %36, %.loopexit57 ]
  %17 = phi i32 [ %tot.promoted, %.lr.ph ], [ %32, %.loopexit57 ]
  %18 = srem i32 %.04560, 960991
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %19
  br label %21

21:                                               ; preds = %22, %16
  %.048.in = phi ptr [ %20, %16 ], [ %24, %22 ]
  %.048 = load i32, ptr %.048.in, align 4, !tbaa !5
  %.not54.not = icmp eq i32 %.048, 0
  br i1 %.not54.not, label %.critedge, label %22

22:                                               ; preds = %21
  %23 = sext i32 %.048 to i64
  %24 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = icmp eq i32 %26, %.04560
  br i1 %27, label %.loopexit57, label %21, !llvm.loop !11

.critedge:                                        ; preds = %21
  %28 = load i32, ptr %20, align 4, !tbaa !5
  %29 = add nsw i32 %17, 1
  store i32 %29, ptr @tot, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %30
  store i32 %28, ptr %31, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %31, i64 4
  store i32 %.04560, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %31, i64 8
  store i32 %.04461, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  store i32 %29, ptr %20, align 4, !tbaa !5
  br label %.loopexit57

.loopexit57:                                      ; preds = %22, %.critedge
  %32 = phi i32 [ %29, %.critedge ], [ %17, %22 ]
  %33 = sext i32 %.04560 to i64
  %34 = mul nsw i64 %33, %10
  %35 = srem i64 %34, %11
  %36 = trunc nsw i64 %35 to i32
  %37 = add nuw i32 %.04461, 1
  %exitcond.not = icmp eq i32 %.04461, %8
  br i1 %exitcond.not, label %._crit_edge, label %16, !llvm.loop !13

38:                                               ; preds = %.lr.ph66, %54
  %.04264 = phi i32 [ %1, %.lr.ph66 ], [ %58, %54 ]
  %.04363 = phi i32 [ 0, %.lr.ph66 ], [ %59, %54 ]
  %39 = srem i32 %.04264, 960991
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %40
  br label %42

42:                                               ; preds = %43, %38
  %.0.in = phi ptr [ %41, %38 ], [ %45, %43 ]
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !5
  %.not53 = icmp eq i32 %.0, 0
  br i1 %.not53, label %54, label %43

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

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

54:                                               ; preds = %42
  %55 = sext i32 %.04264 to i64
  %56 = mul nsw i64 %55, %14
  %57 = srem i64 %56, %15
  %58 = trunc nsw i64 %57 to i32
  %59 = add nuw i32 %.04363, 1
  %exitcond68.not = icmp eq i32 %.04363, %8
  br i1 %exitcond68.not, label %.loopexit, label %38, !llvm.loop !16

.loopexit:                                        ; preds = %54, %._crit_edge, %49, %3
  %.4 = phi i32 [ 0, %3 ], [ %53, %49 ], [ -1, %._crit_edge ], [ -1, %54 ]
  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) #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #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 = !{!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