; LLVM IR from stivalaa/EstimNetDirected :: Test/TestChangeStatsUndirected (undirectedStats)

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

@.str.1 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__.PowerFourCycles = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @FourCycles(ptr 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

declare i32 @num_four_cycles_node(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @num_four_cycles_node_SLOW(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local double @PowerFourCycles(ptr noundef %0, double noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %12 = load double, ptr %4, align 8, !tbaa !9
  %13 = fdiv double 1.000000e+00, %12
  store double %13, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store double 0.000000e+00, ptr %10, align 8, !tbaa !9
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.graph_s, ptr %14, i32 0, i32 1
  %16 = load i32, ptr %15, align 4, !tbaa !15
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %19, label %18

18:                                               ; preds = %2
  br label %20

19:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 124, ptr noundef @__PRETTY_FUNCTION__.PowerFourCycles) #6
  unreachable

20:                                               ; preds = %18
  store i32 0, ptr %5, align 4, !tbaa !18
  br label %21

21:                                               ; preds = %51, %20
  %22 = load i32, ptr %5, align 4, !tbaa !18
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.graph_s, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !19
  %26 = icmp ult i32 %22, %25
  br i1 %26, label %27, label %54

27:                                               ; preds = %21
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = load i32, ptr %5, align 4, !tbaa !18
  %30 = call i32 @num_four_cycles_node(ptr noundef %28, i32 noundef %29)
  %31 = zext i32 %30 to i64
  store i64 %31, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !18
  %34 = call i32 @num_four_cycles_node_SLOW(ptr noundef %32, i32 noundef %33)
  store i32 %34, ptr %11, align 4, !tbaa !18
  %35 = load i32, ptr %11, align 4, !tbaa !18
  %36 = zext i32 %35 to i64
  %37 = load i64, ptr %7, align 8, !tbaa !11
  %38 = icmp eq i64 %36, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %27
  br label %41

40:                                               ; preds = %27
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 129, ptr noundef @__PRETTY_FUNCTION__.PowerFourCycles) #6
  unreachable

41:                                               ; preds = %39
  %42 = load i64, ptr %7, align 8, !tbaa !11
  %43 = load i64, ptr %8, align 8, !tbaa !13
  %44 = add i64 %43, %42
  store i64 %44, ptr %8, align 8, !tbaa !13
  %45 = load i64, ptr %7, align 8, !tbaa !11
  %46 = uitofp i64 %45 to double
  %47 = load double, ptr %6, align 8, !tbaa !9
  %48 = call double @pow(double noundef %46, double noundef %47) #5
  %49 = load double, ptr %10, align 8, !tbaa !9
  %50 = fadd double %49, %48
  store double %50, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %51

51:                                               ; preds = %41
  %52 = load i32, ptr %5, align 4, !tbaa !18
  %53 = add i32 %52, 1
  store i32 %53, ptr %5, align 4, !tbaa !18
  br label %21, !llvm.loop !20

54:                                               ; preds = %21
  %55 = load i64, ptr %8, align 8, !tbaa !13
  %56 = urem i64 %55, 4
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  br label %60

59:                                               ; preds = %54
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 134, ptr noundef @__PRETTY_FUNCTION__.PowerFourCycles) #6
  unreachable

60:                                               ; preds = %58
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = call i64 @FourCycles(ptr noundef %61)
  store i64 %62, ptr %9, align 8, !tbaa !13
  %63 = load i64, ptr %8, align 8, !tbaa !13
  %64 = udiv i64 %63, 4
  %65 = load i64, ptr %9, align 8, !tbaa !13
  %66 = icmp eq i64 %64, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %60
  br label %69

68:                                               ; preds = %60
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 138, ptr noundef @__PRETTY_FUNCTION__.PowerFourCycles) #6
  unreachable

69:                                               ; preds = %67
  %70 = load double, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret double %70
}

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

attributes #0 = { 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 = { noreturn 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 #3 = { "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 "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 = { nounwind }
attributes #6 = { noreturn 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !17, i64 4}
!16 = !{!"graph_s", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !17, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !17, i64 88, !17, i64 92, !17, i64 96, !6, i64 104, !6, i64 112, !17, i64 120, !6, i64 128, !6, i64 136, !17, i64 144, !6, i64 152, !6, i64 160, !17, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !17, i64 200, !17, i64 204, !17, i64 208, !17, i64 212, !17, i64 216, !6, i64 224, !17, i64 232, !17, i64 236, !6, i64 240, !6, i64 248, !17, i64 256, !6, i64 264, !17, i64 272, !6, i64 280, !6, i64 288, !17, i64 296, !17, i64 300, !6, i64 304, !17, i64 312, !6, i64 320}
!17 = !{!"int", !7, i64 0}
!18 = !{!17, !17, i64 0}
!19 = !{!16, !17, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.1 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__.PowerFourCycles = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @FourCycles(ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @num_four_cycles_node(ptr noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local double @PowerFourCycles(ptr noundef %0, double noundef %1) local_unnamed_addr #0 {
  %3 = fdiv double 1.000000e+00, %1
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %.preheader, label %7

.preheader:                                       ; preds = %2
  %6 = load i32, ptr %0, align 8, !tbaa !11
  %.not29 = icmp eq i32 %6, 0
  br i1 %.not29, label %._crit_edge.thread, label %.lr.ph

7:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 124, ptr noundef nonnull @__PRETTY_FUNCTION__.PowerFourCycles) #4
  unreachable

.lr.ph:                                           ; preds = %.preheader, %12
  %.027 = phi i32 [ %18, %12 ], [ 0, %.preheader ]
  %.02026 = phi double [ %17, %12 ], [ 0.000000e+00, %.preheader ]
  %.02125 = phi i64 [ %14, %12 ], [ 0, %.preheader ]
  %8 = tail call i32 @num_four_cycles_node(ptr noundef nonnull %0, i32 noundef %.027) #5
  %9 = tail call i32 @num_four_cycles_node_SLOW(ptr noundef nonnull %0, i32 noundef %.027)
  %10 = icmp eq i32 %9, %8
  br i1 %10, label %12, label %11

11:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 129, ptr noundef nonnull @__PRETTY_FUNCTION__.PowerFourCycles) #4
  unreachable

12:                                               ; preds = %.lr.ph
  %13 = zext i32 %8 to i64
  %14 = add i64 %.02125, %13
  %15 = uitofp i32 %8 to double
  %16 = tail call double @pow(double noundef %15, double noundef %3) #5
  %17 = fadd double %.02026, %16
  %18 = add nuw i32 %.027, 1
  %19 = load i32, ptr %0, align 8, !tbaa !11
  %20 = icmp ult i32 %18, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %12
  %21 = and i64 %14, 3
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %._crit_edge.thread, label %23

23:                                               ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 134, ptr noundef nonnull @__PRETTY_FUNCTION__.PowerFourCycles) #4
  unreachable

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  %.020.lcssa34 = phi double [ %17, %._crit_edge ], [ 0.000000e+00, %.preheader ]
  %.021.lcssa33 = phi i64 [ %14, %._crit_edge ], [ 0, %.preheader ]
  %24 = tail call i64 @FourCycles(ptr noundef nonnull %0)
  %25 = lshr exact i64 %.021.lcssa33, 2
  %26 = icmp eq i64 %25, %24
  br i1 %26, label %28, label %27

27:                                               ; preds = %._crit_edge.thread
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 138, ptr noundef nonnull @__PRETTY_FUNCTION__.PowerFourCycles) #4
  unreachable

28:                                               ; preds = %._crit_edge.thread
  ret double %.020.lcssa34
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3

attributes #0 = { 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 = { noreturn 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 #2 = { "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 = { 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 = { noreturn nounwind }
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, !7, i64 4}
!6 = !{!"graph_s", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !7, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !10, i64 104, !10, i64 112, !7, i64 120, !10, i64 128, !10, i64 136, !7, i64 144, !10, i64 152, !10, i64 160, !7, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !7, i64 200, !7, i64 204, !7, i64 208, !7, i64 212, !7, i64 216, !10, i64 224, !7, i64 232, !7, i64 236, !10, i64 240, !10, i64 248, !7, i64 256, !10, i64 264, !7, i64 272, !10, i64 280, !10, i64 288, !7, i64 296, !7, i64 300, !10, i64 304, !7, i64 312, !10, i64 320}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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