; LLVM IR from stivalaa/EstimNetDirected :: src (changeStatisticsBipartiteUndirected)

; 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 [101 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.changeBipartiteThreeStarsA = external hidden unnamed_addr constant [69 x i8], align 1

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

declare i32 @bipartite_node_mode(ptr noundef, i32 noundef) #1

declare i32 @isEdge(ptr noundef, i32 noundef, i32 noundef) #1

declare i64 @change_s_stars(ptr noundef, i32 noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local double @changeBipartiteThreeStarsA(ptr noundef %0, i32 noundef %1, i32 noundef %2, double noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store double %3, ptr %8, align 8, !tbaa !11
  %9 = load double, ptr %8, align 8, !tbaa !11
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.graph_s, ptr %10, i32 0, i32 2
  %12 = load i32, ptr %11, align 8, !tbaa !13
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %4
  br label %16

15:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 322, ptr noundef @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

16:                                               ; preds = %14
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.graph_s, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 4, !tbaa !15
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  br label %23

22:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 323, ptr noundef @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

23:                                               ; preds = %21
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = call i32 @bipartite_node_mode(ptr noundef %24, i32 noundef %25)
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  br label %30

29:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 324, ptr noundef @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

30:                                               ; preds = %28
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = call i32 @bipartite_node_mode(ptr noundef %31, i32 noundef %32)
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  br label %37

36:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 325, ptr noundef @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

37:                                               ; preds = %35
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = call i32 @isEdge(ptr noundef %38, i32 noundef %39, i32 noundef %40)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %37
  br label %45

44:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 326, ptr noundef @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

45:                                               ; preds = %43
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = call i64 @change_s_stars(ptr noundef %46, i32 noundef %47, i64 noundef 3)
  %49 = uitofp i64 %48 to double
  ret double %49
}

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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"graph_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !6, i64 104, !6, i64 112, !10, i64 120, !6, i64 128, !6, i64 136, !10, i64 144, !6, i64 152, !6, i64 160, !10, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !6, i64 224, !10, i64 232, !10, i64 236, !6, i64 240, !6, i64 248, !10, i64 256, !6, i64 264, !10, i64 272, !6, i64 280, !6, i64 288, !10, i64 296, !10, i64 300, !6, i64 304, !10, i64 312, !6, i64 320}
!15 = !{!14, !10, i64 4}


; 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 [101 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.changeBipartiteThreeStarsA = external hidden unnamed_addr constant [69 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 @bipartite_node_mode(ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare i64 @change_s_stars(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

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

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

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

11:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 323, ptr noundef nonnull @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

12:                                               ; preds = %8
  %13 = tail call i32 @bipartite_node_mode(ptr noundef nonnull %0, i32 noundef %1) #4
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 324, ptr noundef nonnull @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

16:                                               ; preds = %12
  %17 = tail call i32 @bipartite_node_mode(ptr noundef nonnull %0, i32 noundef %2) #4
  %18 = icmp eq i32 %17, 1
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 325, ptr noundef nonnull @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

20:                                               ; preds = %16
  %21 = tail call i32 @isEdge(ptr noundef nonnull %0, i32 noundef %1, i32 noundef %2) #4
  %.not12 = icmp eq i32 %21, 0
  br i1 %.not12, label %23, label %22

22:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 326, ptr noundef nonnull @__PRETTY_FUNCTION__.changeBipartiteThreeStarsA) #3
  unreachable

23:                                               ; preds = %20
  %24 = tail call i64 @change_s_stars(ptr noundef nonnull %0, i32 noundef %1, i64 noundef 3) #4
  %25 = uitofp i64 %24 to double
  ret double %25
}

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 = { noreturn nounwind }
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, !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}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass