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

; 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 [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@__PRETTY_FUNCTION__.changeMatchingInteraction = external hidden unnamed_addr constant [76 x i8], align 1

declare i32 @isArcOrEdge(ptr noundef, i32 noundef, i32 noundef) #0

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

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

16:                                               ; preds = %5
  br label %18

17:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 419, ptr noundef @__PRETTY_FUNCTION__.changeMatchingInteraction) #3
  unreachable

18:                                               ; preds = %16
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.graph_s, ptr %19, i32 0, i32 20
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds ptr, ptr %21, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr %25, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = icmp ne i32 %29, -1
  br i1 %30, label %31, label %118

31:                                               ; preds = %18
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.graph_s, ptr %32, i32 0, i32 20
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds ptr, ptr %34, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %38, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = icmp ne i32 %42, -1
  br i1 %43, label %44, label %118

44:                                               ; preds = %31
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.graph_s, ptr %45, i32 0, i32 20
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds ptr, ptr %47, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %51, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = icmp ne i32 %55, -1
  br i1 %56, label %57, label %118

57:                                               ; preds = %44
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.graph_s, ptr %58, i32 0, i32 20
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = icmp ne i32 %68, -1
  br i1 %69, label %70, label %118

70:                                               ; preds = %57
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.graph_s, ptr %71, i32 0, i32 20
  %73 = load ptr, ptr %72, align 8, !tbaa !11
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %73, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds i32, ptr %77, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.graph_s, ptr %82, i32 0, i32 20
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = load i32, ptr %9, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds ptr, ptr %84, i64 %86
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %88, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = icmp eq i32 %81, %92
  br i1 %93, label %94, label %118

94:                                               ; preds = %70
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.graph_s, ptr %95, i32 0, i32 20
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds ptr, ptr %97, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = load i32, ptr %7, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %101, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.graph_s, ptr %106, i32 0, i32 20
  %108 = load ptr, ptr %107, align 8, !tbaa !11
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds ptr, ptr %108, i64 %110
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = icmp eq i32 %105, %116
  br label %118

118:                                              ; preds = %94, %70, %57, %44, %31, %18
  %119 = phi i1 [ false, %70 ], [ false, %57 ], [ false, %44 ], [ false, %31 ], [ false, %18 ], [ %117, %94 ]
  %120 = zext i1 %119 to i32
  %121 = sitofp i32 %120 to double
  ret double %121
}

attributes #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 = { 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, !6, i64 136}
!12 = !{!"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}


; 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 [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@__PRETTY_FUNCTION__.changeMatchingInteraction = external hidden unnamed_addr constant [76 x i8], align 1

declare i32 @isArcOrEdge(ptr noundef, i32 noundef, i32 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

; Function Attrs: nounwind uwtable
define dso_local double @changeMatchingInteraction(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %6 = tail call i32 @isArcOrEdge(ptr noundef %0, i32 noundef %1, i32 noundef %2) #3
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %8, label %7

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

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 136
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = zext i32 %3 to i64
  %12 = getelementptr inbounds ptr, ptr %10, i64 %11
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = zext i32 %1 to i64
  %15 = getelementptr inbounds i32, ptr %13, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !12
  %.not29 = icmp eq i32 %16, -1
  br i1 %.not29, label %34, label %17

17:                                               ; preds = %8
  %18 = zext i32 %2 to i64
  %19 = getelementptr inbounds i32, ptr %13, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !12
  %.not30 = icmp eq i32 %20, -1
  br i1 %.not30, label %34, label %21

21:                                               ; preds = %17
  %22 = zext i32 %4 to i64
  %23 = getelementptr inbounds ptr, ptr %10, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds i32, ptr %24, i64 %14
  %26 = load i32, ptr %25, align 4, !tbaa !12
  %.not31 = icmp eq i32 %26, -1
  br i1 %.not31, label %34, label %27

27:                                               ; preds = %21
  %28 = getelementptr inbounds i32, ptr %24, i64 %18
  %29 = load i32, ptr %28, align 4, !tbaa !12
  %.not32 = icmp ne i32 %29, -1
  %30 = icmp eq i32 %16, %20
  %or.cond = and i1 %30, %.not32
  br i1 %or.cond, label %31, label %34

31:                                               ; preds = %27
  %32 = icmp eq i32 %26, %29
  %33 = uitofp i1 %32 to double
  br label %34

34:                                               ; preds = %31, %27, %21, %17, %8
  %35 = phi double [ 0.000000e+00, %27 ], [ 0.000000e+00, %21 ], [ 0.000000e+00, %17 ], [ 0.000000e+00, %8 ], [ %33, %31 ]
  ret double %35
}

attributes #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 = { 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 = { nounwind }
attributes #4 = { 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, !10, i64 136}
!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 = !{!10, !10, i64 0}
!12 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass