; LLVM IR from GGiecold-zz/Cluster_Ensembles :: src/Cluster_Ensembles/Hypergraph_Partitioning/metis-5.1.0/libmetis (coarsen)

; 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.ctrl_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, float, ptr, ptr, ptr, float, double, double, double, double, double, double, double, double, double, double, double, double, ptr, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.graph_t = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [140 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@__PRETTY_FUNCTION__.CoarsenGraphNlevels = external hidden unnamed_addr constant [57 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

declare double @gk_CPUSeconds() #1

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__PrintCGraphStats(ptr noundef, ptr noundef) #2

declare ptr @libmetis__imalloc(i64 noundef, ptr noundef) #1

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

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

declare void @gk_errexit(i32 noundef, ptr noundef, ...) #1

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

declare i32 @printf(ptr noundef, ...) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @CoarsenGraphNlevels(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.ctrl_t, ptr %10, i32 0, i32 2
  %12 = load i32, ptr %11, align 8, !tbaa !11
  %13 = and i32 %12, 2
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %21

15:                                               ; preds = %3
  %16 = call double @gk_CPUSeconds()
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ctrl_t, ptr %17, i32 0, i32 31
  %19 = load double, ptr %18, align 8, !tbaa !16
  %20 = fsub double %19, %16
  store double %20, ptr %18, align 8, !tbaa !16
  br label %21

21:                                               ; preds = %15, %3
  store i32 1, ptr %8, align 4, !tbaa !9
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %44, %21
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.graph_t, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %28, label %47

28:                                               ; preds = %22
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.graph_t, ptr %29, i32 0, i32 7
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds i32, ptr %31, i64 0
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.graph_t, ptr %34, i32 0, i32 7
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr %36, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = icmp ne i32 %33, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %28
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %47

43:                                               ; preds = %28
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !9
  br label %22, !llvm.loop !20

47:                                               ; preds = %42, %22
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %76, %47
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.graph_t, ptr %50, i32 0, i32 2
  %52 = load i32, ptr %51, align 8, !tbaa !22
  %53 = icmp slt i32 %49, %52
  br i1 %53, label %54, label %79

54:                                               ; preds = %48
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.graph_t, ptr %55, i32 0, i32 8
  %57 = load ptr, ptr %56, align 8, !tbaa !23
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %57, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = sitofp i32 %61 to double
  %63 = fmul double 1.500000e+00, %62
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ctrl_t, ptr %64, i32 0, i32 6
  %66 = load i32, ptr %65, align 8, !tbaa !24
  %67 = sitofp i32 %66 to double
  %68 = fdiv double %63, %67
  %69 = fptosi double %68 to i32
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ctrl_t, ptr %70, i32 0, i32 19
  %72 = load ptr, ptr %71, align 8, !tbaa !25
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %72, i64 %74
  store i32 %69, ptr %75, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %54
  %77 = load i32, ptr %7, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %7, align 4, !tbaa !9
  br label %48, !llvm.loop !26

79:                                               ; preds = %48
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %182, %79
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %84, label %185

84:                                               ; preds = %80
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ctrl_t, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !11
  %88 = and i32 %87, 4
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %93

90:                                               ; preds = %84
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libmetis__PrintCGraphStats(ptr noundef %91, ptr noundef %92)
  br label %93

93:                                               ; preds = %90, %84
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.graph_t, ptr %94, i32 0, i32 16
  %96 = load ptr, ptr %95, align 8, !tbaa !27
  %97 = icmp eq ptr %96, null
  br i1 %97, label %98, label %106

98:                                               ; preds = %93
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.graph_t, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !28
  %102 = sext i32 %101 to i64
  %103 = call ptr @libmetis__imalloc(i64 noundef %102, ptr noundef @.str)
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.graph_t, ptr %104, i32 0, i32 16
  store ptr %103, ptr %105, align 8, !tbaa !27
  br label %106

106:                                              ; preds = %98, %93
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ctrl_t, ptr %107, i32 0, i32 3
  %109 = load i32, ptr %108, align 4, !tbaa !29
  switch i32 %109, label %131 [
    i32 0, label %110
    i32 1, label %114
  ]

110:                                              ; preds = %106
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = call i32 @libmetis__Match_RM(ptr noundef %111, ptr noundef %112)
  br label %135

114:                                              ; preds = %106
  %115 = load i32, ptr %8, align 4, !tbaa !9
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %122, label %117

117:                                              ; preds = %114
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.graph_t, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !17
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %126

122:                                              ; preds = %117, %114
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = call i32 @libmetis__Match_RM(ptr noundef %123, ptr noundef %124)
  br label %130

126:                                              ; preds = %117
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = call i32 @libmetis__Match_SHEM(ptr noundef %127, ptr noundef %128)
  br label %130

130:                                              ; preds = %126, %122
  br label %135

131:                                              ; preds = %106
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ctrl_t, ptr %132, i32 0, i32 3
  %134 = load i32, ptr %133, align 4, !tbaa !29
  call void (i32, ptr, ...) @gk_errexit(i32 noundef 15, ptr noundef @.str.1, i32 noundef %134)
  br label %135

135:                                              ; preds = %131, %130, %110
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.graph_t, ptr %136, i32 0, i32 29
  %138 = load ptr, ptr %137, align 8, !tbaa !30
  store ptr %138, ptr %5, align 8, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !9
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = call i32 @libmetis__CheckGraph(ptr noundef %139, i32 noundef 0, i32 noundef 1)
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %150, label %142

142:                                              ; preds = %135
  %143 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef 129, ptr noundef @.str.3)
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = call i32 @libmetis__CheckGraph(ptr noundef %144, i32 noundef 0, i32 noundef 1)
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %148

147:                                              ; preds = %142
  br label %149

148:                                              ; preds = %142
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 129, ptr noundef @__PRETTY_FUNCTION__.CoarsenGraphNlevels) #5
  unreachable

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149, %135
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.graph_t, ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !28
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.ctrl_t, ptr %154, i32 0, i32 6
  %156 = load i32, ptr %155, align 8, !tbaa !24
  %157 = icmp slt i32 %153, %156
  br i1 %157, label %180, label %158

158:                                              ; preds = %150
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.graph_t, ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 8, !tbaa !28
  %162 = sitofp i32 %161 to double
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.graph_t, ptr %163, i32 0, i32 30
  %165 = load ptr, ptr %164, align 8, !tbaa !31
  %166 = getelementptr inbounds %struct.graph_t, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 8, !tbaa !28
  %168 = sitofp i32 %167 to double
  %169 = fmul double 8.500000e-01, %168
  %170 = fcmp ogt double %162, %169
  br i1 %170, label %180, label %171

171:                                              ; preds = %158
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.graph_t, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !17
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.graph_t, ptr %175, i32 0, i32 0
  %177 = load i32, ptr %176, align 8, !tbaa !28
  %178 = sdiv i32 %177, 2
  %179 = icmp slt i32 %174, %178
  br i1 %179, label %180, label %181

180:                                              ; preds = %171, %158, %150
  br label %185

181:                                              ; preds = %171
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %9, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %9, align 4, !tbaa !9
  br label %80, !llvm.loop !32

185:                                              ; preds = %180, %80
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.ctrl_t, ptr %186, i32 0, i32 2
  %188 = load i32, ptr %187, align 8, !tbaa !11
  %189 = and i32 %188, 4
  %190 = icmp ne i32 %189, 0
  br i1 %190, label %191, label %194

191:                                              ; preds = %185
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libmetis__PrintCGraphStats(ptr noundef %192, ptr noundef %193)
  br label %194

194:                                              ; preds = %191, %185
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.ctrl_t, ptr %195, i32 0, i32 2
  %197 = load i32, ptr %196, align 8, !tbaa !11
  %198 = and i32 %197, 2
  %199 = icmp ne i32 %198, 0
  br i1 %199, label %200, label %206

200:                                              ; preds = %194
  %201 = call double @gk_CPUSeconds()
  %202 = load ptr, ptr %4, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.ctrl_t, ptr %202, i32 0, i32 31
  %204 = load double, ptr %203, align 8, !tbaa !16
  %205 = fadd double %204, %201
  store double %205, ptr %203, align 8, !tbaa !16
  br label %206

206:                                              ; preds = %200, %194
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret ptr %207
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 }
attributes #5 = { 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, !10, i64 8}
!12 = !{!"ctrl_t", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !13, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !14, i64 224, !6, i64 232, !15, i64 240, !15, i64 248, !15, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320}
!13 = !{!"float", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !14, i64 168}
!17 = !{!18, !10, i64 4}
!18 = !{!"graph_t", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !6, i64 120, !6, i64 128, !10, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208}
!19 = !{!18, !6, i64 48}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!18, !10, i64 8}
!23 = !{!18, !6, i64 56}
!24 = !{!12, !10, i64 24}
!25 = !{!12, !6, i64 80}
!26 = distinct !{!26, !21}
!27 = !{!18, !6, i64 104}
!28 = !{!18, !10, i64 0}
!29 = !{!12, !10, i64 12}
!30 = !{!18, !6, i64 200}
!31 = !{!18, !6, i64 208}
!32 = distinct !{!32, !21}


; 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 [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [140 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@__PRETTY_FUNCTION__.CoarsenGraphNlevels = external hidden unnamed_addr constant [57 x i8], align 1

declare double @gk_CPUSeconds() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__PrintCGraphStats(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @libmetis__imalloc(i64 noundef, ptr noundef) local_unnamed_addr #0

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

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

declare void @gk_errexit(i32 noundef, ptr noundef, ...) local_unnamed_addr #0

declare i32 @libmetis__CheckGraph(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

7:                                                ; preds = %3
  %8 = tail call double @gk_CPUSeconds() #4
  %9 = getelementptr inbounds i8, ptr %0, i64 168
  %10 = load double, ptr %9, align 8, !tbaa !14
  %11 = fsub double %10, %8
  store double %11, ptr %9, align 8, !tbaa !14
  br label %12

12:                                               ; preds = %7, %3
  %13 = getelementptr inbounds i8, ptr %1, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !15
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12
  %16 = getelementptr inbounds i8, ptr %1, i64 48
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %18 = load i32, ptr %17, align 4, !tbaa !18
  %19 = zext nneg i32 %14 to i64
  %wide.trip.count = zext nneg i32 %14 to i64
  %20 = getelementptr inbounds i8, ptr %17, i64 4
  %21 = load i32, ptr %20, align 4, !tbaa !18
  %.not5595 = icmp eq i32 %18, %21
  br i1 %.not5595, label %.lr.ph97, label %._crit_edge

.lr.ph97:                                         ; preds = %.lr.ph, %22
  %indvars.iv96 = phi i64 [ %indvars.iv.next, %22 ], [ 1, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv96, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %22, !llvm.loop !19

22:                                               ; preds = %.lr.ph97
  %23 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next
  %24 = load i32, ptr %23, align 4, !tbaa !18
  %.not55 = icmp eq i32 %18, %24
  br i1 %.not55, label %.lr.ph97, label %._crit_edge.loopexit, !llvm.loop !19

._crit_edge.loopexit:                             ; preds = %.lr.ph97, %22
  %25 = icmp ult i64 %indvars.iv.next, %19
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph, %12
  %.lcssa = phi i1 [ false, %12 ], [ true, %.lr.ph ], [ %25, %._crit_edge.loopexit ]
  %26 = getelementptr inbounds i8, ptr %1, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !21
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph67, label %.preheader

.lr.ph67:                                         ; preds = %._crit_edge
  %29 = getelementptr inbounds i8, ptr %1, i64 56
  %30 = load ptr, ptr %29, align 8, !tbaa !22
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = getelementptr inbounds i8, ptr %0, i64 80
  %33 = load ptr, ptr %32, align 8, !tbaa !23
  br label %84

.preheader:                                       ; preds = %84, %._crit_edge
  %34 = icmp sgt i32 %2, 0
  %.pre88 = load i32, ptr %4, align 8, !tbaa !5
  br i1 %34, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %.preheader
  %35 = getelementptr inbounds i8, ptr %0, i64 12
  %36 = getelementptr inbounds i8, ptr %0, i64 24
  %37 = and i32 %.pre88, 4
  %.not56.peel = icmp eq i32 %37, 0
  br i1 %.not56.peel, label %39, label %38

38:                                               ; preds = %.lr.ph71
  tail call void @libmetis__PrintCGraphStats(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %39

39:                                               ; preds = %38, %.lr.ph71
  %40 = getelementptr inbounds i8, ptr %1, i64 104
  %41 = load ptr, ptr %40, align 8, !tbaa !24
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %47

43:                                               ; preds = %39
  %44 = load i32, ptr %1, align 8, !tbaa !25
  %45 = sext i32 %44 to i64
  %46 = tail call ptr @libmetis__imalloc(i64 noundef %45, ptr noundef nonnull @.str) #4
  store ptr %46, ptr %40, align 8, !tbaa !24
  br label %47

47:                                               ; preds = %43, %39
  %48 = load i32, ptr %35, align 4, !tbaa !26
  switch i32 %48, label %59 [
    i32 0, label %57
    i32 1, label %49
  ]

49:                                               ; preds = %47
  br i1 %.lcssa, label %50, label %55

50:                                               ; preds = %49
  %51 = load i32, ptr %13, align 4, !tbaa !15
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %55, label %53

53:                                               ; preds = %50
  %54 = tail call i32 @libmetis__Match_SHEM(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %60

55:                                               ; preds = %50, %49
  %56 = tail call i32 @libmetis__Match_RM(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %60

57:                                               ; preds = %47
  %58 = tail call i32 @libmetis__Match_RM(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %60

59:                                               ; preds = %47
  tail call void (i32, ptr, ...) @gk_errexit(i32 noundef 15, ptr noundef nonnull @.str.1, i32 noundef %48) #4
  br label %60

60:                                               ; preds = %59, %57, %55, %53
  %61 = getelementptr inbounds i8, ptr %1, i64 200
  %62 = load ptr, ptr %61, align 8, !tbaa !27
  %63 = tail call i32 @libmetis__CheckGraph(ptr noundef %62, i32 noundef 0, i32 noundef 1) #4
  %.not58.peel = icmp eq i32 %63, 0
  br i1 %.not58.peel, label %64, label %67

64:                                               ; preds = %60
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 129, ptr noundef nonnull @.str.3)
  %66 = tail call i32 @libmetis__CheckGraph(ptr noundef %62, i32 noundef 0, i32 noundef 1) #4
  %.not59.peel = icmp eq i32 %66, 0
  br i1 %.not59.peel, label %.loopexit, label %67

67:                                               ; preds = %64, %60
  %68 = load i32, ptr %62, align 8, !tbaa !25
  %69 = load i32, ptr %36, align 8, !tbaa !28
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %._crit_edge72.loopexit, label %71

71:                                               ; preds = %67
  %72 = sitofp i32 %68 to double
  %73 = getelementptr inbounds i8, ptr %62, i64 208
  %74 = load ptr, ptr %73, align 8, !tbaa !29
  %75 = load i32, ptr %74, align 8, !tbaa !25
  %76 = sitofp i32 %75 to double
  %77 = fmul double %76, 8.500000e-01
  %78 = fcmp olt double %77, %72
  br i1 %78, label %._crit_edge72.loopexit, label %79

79:                                               ; preds = %71
  %80 = getelementptr inbounds i8, ptr %62, i64 4
  %81 = load i32, ptr %80, align 4, !tbaa !15
  %82 = sdiv i32 %68, 2
  %83 = icmp slt i32 %81, %82
  %exitcond85.peel.not = icmp eq i32 %2, 1
  %or.cond = or i1 %83, %exitcond85.peel.not
  br i1 %or.cond, label %._crit_edge72.loopexit, label %.peel.next

84:                                               ; preds = %.lr.ph67, %84
  %indvars.iv82 = phi i64 [ 0, %.lr.ph67 ], [ %indvars.iv.next83, %84 ]
  %85 = getelementptr inbounds i32, ptr %30, i64 %indvars.iv82
  %86 = load i32, ptr %85, align 4, !tbaa !18
  %87 = sitofp i32 %86 to double
  %88 = fmul double %87, 1.500000e+00
  %89 = load i32, ptr %31, align 8, !tbaa !28
  %90 = sitofp i32 %89 to double
  %91 = fdiv double %88, %90
  %92 = fptosi double %91 to i32
  %93 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv82
  store i32 %92, ptr %93, align 4, !tbaa !18
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %94 = load i32, ptr %26, align 8, !tbaa !21
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next83, %95
  br i1 %96, label %84, label %.preheader, !llvm.loop !30

.peel.next:                                       ; preds = %79, %140
  %.070 = phi i32 [ %145, %140 ], [ 1, %79 ]
  %.05268 = phi ptr [ %123, %140 ], [ %62, %79 ]
  %97 = load i32, ptr %4, align 8, !tbaa !5
  %98 = and i32 %97, 4
  %.not56 = icmp eq i32 %98, 0
  br i1 %.not56, label %100, label %99

99:                                               ; preds = %.peel.next
  tail call void @libmetis__PrintCGraphStats(ptr noundef nonnull %0, ptr noundef nonnull %.05268)
  br label %100

100:                                              ; preds = %99, %.peel.next
  %101 = getelementptr inbounds i8, ptr %.05268, i64 104
  %102 = load ptr, ptr %101, align 8, !tbaa !24
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %108

104:                                              ; preds = %100
  %105 = load i32, ptr %.05268, align 8, !tbaa !25
  %106 = sext i32 %105 to i64
  %107 = tail call ptr @libmetis__imalloc(i64 noundef %106, ptr noundef nonnull @.str) #4
  store ptr %107, ptr %101, align 8, !tbaa !24
  br label %108

108:                                              ; preds = %104, %100
  %109 = load i32, ptr %35, align 4, !tbaa !26
  switch i32 %109, label %120 [
    i32 0, label %110
    i32 1, label %112
  ]

110:                                              ; preds = %108
  %111 = tail call i32 @libmetis__Match_RM(ptr noundef nonnull %0, ptr noundef nonnull %.05268)
  br label %121

112:                                              ; preds = %108
  %113 = getelementptr inbounds i8, ptr %.05268, i64 4
  %114 = load i32, ptr %113, align 4, !tbaa !15
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %118

116:                                              ; preds = %112
  %117 = tail call i32 @libmetis__Match_RM(ptr noundef nonnull %0, ptr noundef nonnull %.05268)
  br label %121

118:                                              ; preds = %112
  %119 = tail call i32 @libmetis__Match_SHEM(ptr noundef nonnull %0, ptr noundef nonnull %.05268)
  br label %121

120:                                              ; preds = %108
  tail call void (i32, ptr, ...) @gk_errexit(i32 noundef 15, ptr noundef nonnull @.str.1, i32 noundef %109) #4
  br label %121

121:                                              ; preds = %116, %118, %120, %110
  %122 = getelementptr inbounds i8, ptr %.05268, i64 200
  %123 = load ptr, ptr %122, align 8, !tbaa !27
  %124 = tail call i32 @libmetis__CheckGraph(ptr noundef %123, i32 noundef 0, i32 noundef 1) #4
  %.not58 = icmp eq i32 %124, 0
  br i1 %.not58, label %125, label %128

125:                                              ; preds = %121
  %126 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 129, ptr noundef nonnull @.str.3)
  %127 = tail call i32 @libmetis__CheckGraph(ptr noundef %123, i32 noundef 0, i32 noundef 1) #4
  %.not59 = icmp eq i32 %127, 0
  br i1 %.not59, label %.loopexit, label %128

.loopexit:                                        ; preds = %125, %64
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 129, ptr noundef nonnull @__PRETTY_FUNCTION__.CoarsenGraphNlevels) #5
  unreachable

128:                                              ; preds = %125, %121
  %129 = load i32, ptr %123, align 8, !tbaa !25
  %130 = load i32, ptr %36, align 8, !tbaa !28
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %._crit_edge72.loopexit, label %132

132:                                              ; preds = %128
  %133 = sitofp i32 %129 to double
  %134 = getelementptr inbounds i8, ptr %123, i64 208
  %135 = load ptr, ptr %134, align 8, !tbaa !29
  %136 = load i32, ptr %135, align 8, !tbaa !25
  %137 = sitofp i32 %136 to double
  %138 = fmul double %137, 8.500000e-01
  %139 = fcmp olt double %138, %133
  br i1 %139, label %._crit_edge72.loopexit, label %140

140:                                              ; preds = %132
  %141 = getelementptr inbounds i8, ptr %123, i64 4
  %142 = load i32, ptr %141, align 4, !tbaa !15
  %143 = sdiv i32 %129, 2
  %144 = icmp slt i32 %142, %143
  %145 = add nuw nsw i32 %.070, 1
  %exitcond85.not = icmp eq i32 %145, %2
  %or.cond92 = select i1 %144, i1 true, i1 %exitcond85.not
  br i1 %or.cond92, label %._crit_edge72.loopexit, label %.peel.next, !llvm.loop !31

._crit_edge72.loopexit:                           ; preds = %128, %132, %140, %79, %71, %67
  %.lcssa81 = phi ptr [ %62, %67 ], [ %62, %71 ], [ %62, %79 ], [ %123, %140 ], [ %123, %132 ], [ %123, %128 ]
  %.pre = load i32, ptr %4, align 8, !tbaa !5
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %.preheader
  %146 = phi i32 [ %.pre88, %.preheader ], [ %.pre, %._crit_edge72.loopexit ]
  %.153 = phi ptr [ %1, %.preheader ], [ %.lcssa81, %._crit_edge72.loopexit ]
  %147 = and i32 %146, 4
  %.not60 = icmp eq i32 %147, 0
  br i1 %.not60, label %149, label %148

148:                                              ; preds = %._crit_edge72
  tail call void @libmetis__PrintCGraphStats(ptr noundef nonnull %0, ptr noundef nonnull %.153)
  %.pre89 = load i32, ptr %4, align 8, !tbaa !5
  br label %149

149:                                              ; preds = %148, %._crit_edge72
  %150 = phi i32 [ %.pre89, %148 ], [ %146, %._crit_edge72 ]
  %151 = and i32 %150, 2
  %.not61 = icmp eq i32 %151, 0
  br i1 %.not61, label %157, label %152

152:                                              ; preds = %149
  %153 = tail call double @gk_CPUSeconds() #4
  %154 = getelementptr inbounds i8, ptr %0, i64 168
  %155 = load double, ptr %154, align 8, !tbaa !14
  %156 = fadd double %153, %155
  store double %156, ptr %154, align 8, !tbaa !14
  br label %157

157:                                              ; preds = %152, %149
  ret ptr %.153
}

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 = { 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 = { nofree 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 = { 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 #4 = { nounwind }
attributes #5 = { 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, !7, i64 8}
!6 = !{!"ctrl_t", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !11, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !11, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !10, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, 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 = !{!"float", !8, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!6, !12, i64 168}
!15 = !{!16, !7, i64 4}
!16 = !{!"graph_t", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !10, i64 96, !10, i64 104, !7, i64 112, !7, i64 116, !10, i64 120, !10, i64 128, !7, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208}
!17 = !{!16, !10, i64 48}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!16, !7, i64 8}
!22 = !{!16, !10, i64 56}
!23 = !{!6, !10, i64 80}
!24 = !{!16, !10, i64 104}
!25 = !{!16, !7, i64 0}
!26 = !{!6, !7, i64 12}
!27 = !{!16, !10, i64 200}
!28 = !{!6, !7, i64 24}
!29 = !{!16, !10, i64 208}
!30 = distinct !{!30, !20}
!31 = distinct !{!31, !20, !32}
!32 = !{!"llvm.loop.peeled.count", i32 1}


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