; LLVM IR from stivalaa/EstimNetDirected :: Test/TestChangeStatsBipartite (bipartiteStats)

; 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 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [42 x i8], align 1
@__PRETTY_FUNCTION__.PowerFourCyclesB = external hidden unnamed_addr constant [49 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @FourCyclesB(ptr noundef) #3

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

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

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

18:                                               ; preds = %2
  br label %20

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

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

25:                                               ; preds = %20
  br label %27

26:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 696, ptr noundef @__PRETTY_FUNCTION__.PowerFourCyclesB) #6
  unreachable

27:                                               ; preds = %25
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.graph_s, ptr %28, i32 0, i32 13
  %30 = load i32, ptr %29, align 8, !tbaa !18
  store i32 %30, ptr %5, align 4, !tbaa !11
  br label %31

31:                                               ; preds = %66, %27
  %32 = load i32, ptr %5, align 4, !tbaa !11
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.graph_s, ptr %33, i32 0, i32 13
  %35 = load i32, ptr %34, align 8, !tbaa !18
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.graph_s, ptr %36, i32 0, i32 14
  %38 = load i32, ptr %37, align 4, !tbaa !19
  %39 = add i32 %35, %38
  %40 = icmp ult i32 %32, %39
  br i1 %40, label %41, label %69

41:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = load i32, ptr %5, align 4, !tbaa !11
  %44 = call i32 @num_four_cycles_node_SLOW(ptr noundef %42, i32 noundef %43)
  store i32 %44, ptr %11, align 4, !tbaa !11
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !11
  %47 = call i32 @num_four_cycles_node(ptr noundef %45, i32 noundef %46)
  store i32 %47, ptr %8, align 4, !tbaa !11
  %48 = load i32, ptr %8, align 4, !tbaa !11
  %49 = load i32, ptr %11, align 4, !tbaa !11
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %41
  br label %53

52:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 701, ptr noundef @__PRETTY_FUNCTION__.PowerFourCyclesB) #6
  unreachable

53:                                               ; preds = %51
  %54 = load i32, ptr %8, align 4, !tbaa !11
  %55 = zext i32 %54 to i64
  %56 = load i64, ptr %9, align 8, !tbaa !13
  %57 = add i64 %56, %55
  store i64 %57, ptr %9, align 8, !tbaa !13
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !11
  %60 = call i32 @num_four_cycles_node(ptr noundef %58, i32 noundef %59)
  %61 = uitofp i32 %60 to double
  %62 = load double, ptr %6, align 8, !tbaa !9
  %63 = call double @pow(double noundef %61, double noundef %62) #5
  %64 = load double, ptr %7, align 8, !tbaa !9
  %65 = fadd double %64, %63
  store double %65, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %66

66:                                               ; preds = %53
  %67 = load i32, ptr %5, align 4, !tbaa !11
  %68 = add i32 %67, 1
  store i32 %68, ptr %5, align 4, !tbaa !11
  br label %31, !llvm.loop !20

69:                                               ; preds = %31
  %70 = load i64, ptr %9, align 8, !tbaa !13
  %71 = urem i64 %70, 2
  %72 = icmp eq i64 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  br label %75

74:                                               ; preds = %69
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 706, ptr noundef @__PRETTY_FUNCTION__.PowerFourCyclesB) #6
  unreachable

75:                                               ; preds = %73
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = call i64 @FourCyclesB(ptr noundef %76)
  store i64 %77, ptr %10, align 8, !tbaa !13
  %78 = load i64, ptr %9, align 8, !tbaa !13
  %79 = udiv i64 %78, 2
  %80 = load i64, ptr %10, align 8, !tbaa !13
  %81 = icmp eq i64 %79, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %75
  br label %84

83:                                               ; preds = %75
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 708, ptr noundef @__PRETTY_FUNCTION__.PowerFourCyclesB) #6
  unreachable

84:                                               ; preds = %82
  %85 = load double, ptr %7, 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 4, 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 %85
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !12, i64 8}
!16 = !{!"graph_s", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !6, i64 128, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !12, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !12, i64 200, !12, i64 204, !12, i64 208, !12, i64 212, !12, i64 216, !6, i64 224, !12, i64 232, !12, i64 236, !6, i64 240, !6, i64 248, !12, i64 256, !6, i64 264, !12, i64 272, !6, i64 280, !6, i64 288, !12, i64 296, !12, i64 300, !6, i64 304, !12, i64 312, !6, i64 320}
!17 = !{!16, !12, i64 4}
!18 = !{!16, !12, i64 88}
!19 = !{!16, !12, i64 92}
!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 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [42 x i8], align 1
@__PRETTY_FUNCTION__.PowerFourCyclesB = external hidden unnamed_addr constant [49 x i8], align 1

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

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

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

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

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

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

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

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !11
  %.not27 = icmp eq i32 %9, 0
  br i1 %.not27, label %11, label %10

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

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 88
  %13 = load i32, ptr %12, align 8, !tbaa !12
  %14 = getelementptr inbounds i8, ptr %0, i64 92
  %15 = load i32, ptr %14, align 4, !tbaa !13
  %16 = add i32 %15, %13
  %17 = icmp ult i32 %13, %16
  br i1 %17, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %11, %22
  %.032 = phi i32 [ %29, %22 ], [ %13, %11 ]
  %.02431 = phi double [ %28, %22 ], [ 0.000000e+00, %11 ]
  %.02530 = phi i64 [ %24, %22 ], [ 0, %11 ]
  %18 = tail call i32 @num_four_cycles_node_SLOW(ptr noundef nonnull %0, i32 noundef %.032)
  %19 = tail call i32 @num_four_cycles_node(ptr noundef nonnull %0, i32 noundef %.032) #5
  %20 = icmp eq i32 %19, %18
  br i1 %20, label %22, label %21

21:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 701, ptr noundef nonnull @__PRETTY_FUNCTION__.PowerFourCyclesB) #4
  unreachable

22:                                               ; preds = %.lr.ph
  %23 = zext i32 %18 to i64
  %24 = add i64 %.02530, %23
  %25 = tail call i32 @num_four_cycles_node(ptr noundef nonnull %0, i32 noundef %.032) #5
  %26 = uitofp i32 %25 to double
  %27 = tail call double @pow(double noundef %26, double noundef %3) #5
  %28 = fadd double %.02431, %27
  %29 = add nuw i32 %.032, 1
  %30 = load i32, ptr %12, align 8, !tbaa !12
  %31 = load i32, ptr %14, align 4, !tbaa !13
  %32 = add i32 %31, %30
  %33 = icmp ult i32 %29, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %22
  %34 = and i64 %24, 1
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %._crit_edge.thread, label %36

36:                                               ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 706, ptr noundef nonnull @__PRETTY_FUNCTION__.PowerFourCyclesB) #4
  unreachable

._crit_edge.thread:                               ; preds = %11, %._crit_edge
  %.024.lcssa38 = phi double [ %28, %._crit_edge ], [ 0.000000e+00, %11 ]
  %.025.lcssa37 = phi i64 [ %24, %._crit_edge ], [ 0, %11 ]
  %37 = tail call i64 @FourCyclesB(ptr noundef nonnull %0)
  %38 = lshr exact i64 %.025.lcssa37, 1
  %39 = icmp eq i64 %38, %37
  br i1 %39, label %41, label %40

40:                                               ; preds = %._crit_edge.thread
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 708, ptr noundef nonnull @__PRETTY_FUNCTION__.PowerFourCyclesB) #4
  unreachable

41:                                               ; preds = %._crit_edge.thread
  ret double %.024.lcssa38
}

attributes #0 = { 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 #1 = { "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 = { 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 = { 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 8}
!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 4}
!12 = !{!6, !7, i64 88}
!13 = !{!6, !7, i64 92}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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