; LLVM IR from ekoontz/graphlab :: src/graphlab/extern/metis/libmetis/mcoarsen.ll_libmetis (MCCoarsen2Way)

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

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1

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

13:                                               ; preds = %2
  %14 = call double @gk_CPUSeconds()
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.controldef, ptr %15, i32 0, i32 16
  %17 = load double, ptr %16, align 8, !tbaa !15
  %18 = fsub double %17, %14
  store double %18, ptr %16, align 8, !tbaa !15
  br label %19

19:                                               ; preds = %13, %2
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %20, ptr %7, align 8, !tbaa !5
  store i64 0, ptr %6, align 8, !tbaa !16
  br label %21

21:                                               ; preds = %166, %19
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.controldef, ptr %22, i32 0, i32 1
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = and i64 %24, 4
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %27, label %75

27:                                               ; preds = %21
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.graphdef, ptr %28, i32 0, i32 0
  %30 = load i64, ptr %29, align 8, !tbaa !17
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.graphdef, ptr %31, i32 0, i32 1
  %33 = load i64, ptr %32, align 8, !tbaa !20
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.graphdef, ptr %34, i32 0, i32 0
  %36 = load i64, ptr %35, align 8, !tbaa !17
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.graphdef, ptr %37, i32 0, i32 13
  %39 = load ptr, ptr %38, align 8, !tbaa !21
  %40 = call i64 @libmetis__idxsum(i64 noundef %36, ptr noundef %39, i64 noundef 1)
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.controldef, ptr %41, i32 0, i32 0
  %43 = load i64, ptr %42, align 8, !tbaa !22
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.controldef, ptr %44, i32 0, i32 6
  %46 = load float, ptr %45, align 8, !tbaa !23
  %47 = fpext float %46 to double
  %48 = call i32 (ptr, ...) @mprintf(ptr noundef @.str, i64 noundef %30, i64 noundef %33, i64 noundef %40, i64 noundef %43, double noundef %47)
  store i64 0, ptr %5, align 8, !tbaa !16
  br label %49

49:                                               ; preds = %70, %27
  %50 = load i64, ptr %5, align 8, !tbaa !16
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.graphdef, ptr %51, i32 0, i32 28
  %53 = load i64, ptr %52, align 8, !tbaa !24
  %54 = icmp slt i64 %50, %53
  br i1 %54, label %55, label %73

55:                                               ; preds = %49
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.graphdef, ptr %56, i32 0, i32 0
  %58 = load i64, ptr %57, align 8, !tbaa !17
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.graphdef, ptr %59, i32 0, i32 29
  %61 = load ptr, ptr %60, align 8, !tbaa !25
  %62 = load i64, ptr %5, align 8, !tbaa !16
  %63 = getelementptr inbounds float, ptr %61, i64 %62
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.graphdef, ptr %64, i32 0, i32 28
  %66 = load i64, ptr %65, align 8, !tbaa !24
  %67 = call float @gk_fsum(i64 noundef %58, ptr noundef %63, i64 noundef %66)
  %68 = fpext float %67 to double
  %69 = call i32 (ptr, ...) @mprintf(ptr noundef @.str.1, double noundef %68)
  br label %70

70:                                               ; preds = %55
  %71 = load i64, ptr %5, align 8, !tbaa !16
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %5, align 8, !tbaa !16
  br label %49, !llvm.loop !26

73:                                               ; preds = %49
  %74 = call i32 (ptr, ...) @mprintf(ptr noundef @.str.2)
  br label %75

75:                                               ; preds = %73, %21
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.graphdef, ptr %76, i32 0, i32 1
  %78 = load i64, ptr %77, align 8, !tbaa !20
  %79 = icmp eq i64 %78, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %75
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_RM(ptr noundef %81, ptr noundef %82)
  br label %130

83:                                               ; preds = %75
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.controldef, ptr %84, i32 0, i32 2
  %86 = load i64, ptr %85, align 8, !tbaa !28
  switch i64 %86, label %125 [
    i64 1, label %87
    i64 2, label %90
    i64 3, label %100
    i64 4, label %110
    i64 5, label %113
    i64 6, label %116
    i64 7, label %119
    i64 8, label %122
  ]

87:                                               ; preds = %83
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_RM(ptr noundef %88, ptr noundef %89)
  br label %129

90:                                               ; preds = %83
  %91 = load i64, ptr %6, align 8, !tbaa !16
  %92 = icmp slt i64 %91, 1
  br i1 %92, label %93, label %96

93:                                               ; preds = %90
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_RM(ptr noundef %94, ptr noundef %95)
  br label %99

96:                                               ; preds = %90
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_HEM(ptr noundef %97, ptr noundef %98)
  br label %99

99:                                               ; preds = %96, %93
  br label %129

100:                                              ; preds = %83
  %101 = load i64, ptr %6, align 8, !tbaa !16
  %102 = icmp slt i64 %101, 1
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_RM(ptr noundef %104, ptr noundef %105)
  br label %109

106:                                              ; preds = %100
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_SHEM(ptr noundef %107, ptr noundef %108)
  br label %109

109:                                              ; preds = %106, %103
  br label %129

110:                                              ; preds = %83
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_SHEM(ptr noundef %111, ptr noundef %112)
  br label %129

113:                                              ; preds = %83
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_SHEBM(ptr noundef %114, ptr noundef %115, i64 noundef 1)
  br label %129

116:                                              ; preds = %83
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_SHEBM(ptr noundef %117, ptr noundef %118, i64 noundef -1)
  br label %129

119:                                              ; preds = %83
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_SBHEM(ptr noundef %120, ptr noundef %121, i64 noundef 1)
  br label %129

122:                                              ; preds = %83
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MCMatch_SBHEM(ptr noundef %123, ptr noundef %124, i64 noundef -1)
  br label %129

125:                                              ; preds = %83
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.controldef, ptr %126, i32 0, i32 2
  %128 = load i64, ptr %127, align 8, !tbaa !28
  call void (ptr, ...) @errexit(ptr noundef @.str.3, i64 noundef %128)
  br label %129

129:                                              ; preds = %125, %122, %119, %116, %113, %110, %109, %99, %87
  br label %130

130:                                              ; preds = %129, %80
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.graphdef, ptr %131, i32 0, i32 31
  %133 = load ptr, ptr %132, align 8, !tbaa !29
  store ptr %133, ptr %7, align 8, !tbaa !5
  %134 = load i64, ptr %6, align 8, !tbaa !16
  %135 = add nsw i64 %134, 1
  store i64 %135, ptr %6, align 8, !tbaa !16
  br label %136

136:                                              ; preds = %130
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.graphdef, ptr %137, i32 0, i32 0
  %139 = load i64, ptr %138, align 8, !tbaa !17
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.controldef, ptr %140, i32 0, i32 0
  %142 = load i64, ptr %141, align 8, !tbaa !22
  %143 = icmp sgt i64 %139, %142
  br i1 %143, label %144, label %166

144:                                              ; preds = %136
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.graphdef, ptr %145, i32 0, i32 0
  %147 = load i64, ptr %146, align 8, !tbaa !17
  %148 = sitofp i64 %147 to double
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.graphdef, ptr %149, i32 0, i32 32
  %151 = load ptr, ptr %150, align 8, !tbaa !30
  %152 = getelementptr inbounds %struct.graphdef, ptr %151, i32 0, i32 0
  %153 = load i64, ptr %152, align 8, !tbaa !17
  %154 = sitofp i64 %153 to double
  %155 = fmul double 0x3FEFAE147AE147AE, %154
  %156 = fcmp olt double %148, %155
  br i1 %156, label %157, label %166

157:                                              ; preds = %144
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.graphdef, ptr %158, i32 0, i32 1
  %160 = load i64, ptr %159, align 8, !tbaa !20
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.graphdef, ptr %161, i32 0, i32 0
  %163 = load i64, ptr %162, align 8, !tbaa !17
  %164 = sdiv i64 %163, 2
  %165 = icmp sgt i64 %160, %164
  br label %166

166:                                              ; preds = %157, %144, %136
  %167 = phi i1 [ false, %144 ], [ false, %136 ], [ %165, %157 ]
  br i1 %167, label %21, label %168, !llvm.loop !31

168:                                              ; preds = %166
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.controldef, ptr %169, i32 0, i32 1
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %172 = and i64 %171, 4
  %173 = icmp ne i64 %172, 0
  br i1 %173, label %174, label %222

174:                                              ; preds = %168
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.graphdef, ptr %175, i32 0, i32 0
  %177 = load i64, ptr %176, align 8, !tbaa !17
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.graphdef, ptr %178, i32 0, i32 1
  %180 = load i64, ptr %179, align 8, !tbaa !20
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.graphdef, ptr %181, i32 0, i32 0
  %183 = load i64, ptr %182, align 8, !tbaa !17
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.graphdef, ptr %184, i32 0, i32 13
  %186 = load ptr, ptr %185, align 8, !tbaa !21
  %187 = call i64 @libmetis__idxsum(i64 noundef %183, ptr noundef %186, i64 noundef 1)
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.controldef, ptr %188, i32 0, i32 0
  %190 = load i64, ptr %189, align 8, !tbaa !22
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.controldef, ptr %191, i32 0, i32 6
  %193 = load float, ptr %192, align 8, !tbaa !23
  %194 = fpext float %193 to double
  %195 = call i32 (ptr, ...) @mprintf(ptr noundef @.str, i64 noundef %177, i64 noundef %180, i64 noundef %187, i64 noundef %190, double noundef %194)
  store i64 0, ptr %5, align 8, !tbaa !16
  br label %196

196:                                              ; preds = %217, %174
  %197 = load i64, ptr %5, align 8, !tbaa !16
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.graphdef, ptr %198, i32 0, i32 28
  %200 = load i64, ptr %199, align 8, !tbaa !24
  %201 = icmp slt i64 %197, %200
  br i1 %201, label %202, label %220

202:                                              ; preds = %196
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.graphdef, ptr %203, i32 0, i32 0
  %205 = load i64, ptr %204, align 8, !tbaa !17
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.graphdef, ptr %206, i32 0, i32 29
  %208 = load ptr, ptr %207, align 8, !tbaa !25
  %209 = load i64, ptr %5, align 8, !tbaa !16
  %210 = getelementptr inbounds float, ptr %208, i64 %209
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.graphdef, ptr %211, i32 0, i32 28
  %213 = load i64, ptr %212, align 8, !tbaa !24
  %214 = call float @gk_fsum(i64 noundef %205, ptr noundef %210, i64 noundef %213)
  %215 = fpext float %214 to double
  %216 = call i32 (ptr, ...) @mprintf(ptr noundef @.str.1, double noundef %215)
  br label %217

217:                                              ; preds = %202
  %218 = load i64, ptr %5, align 8, !tbaa !16
  %219 = add nsw i64 %218, 1
  store i64 %219, ptr %5, align 8, !tbaa !16
  br label %196, !llvm.loop !32

220:                                              ; preds = %196
  %221 = call i32 (ptr, ...) @mprintf(ptr noundef @.str.2)
  br label %222

222:                                              ; preds = %220, %168
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.controldef, ptr %223, i32 0, i32 1
  %225 = load i64, ptr %224, align 8, !tbaa !9
  %226 = and i64 %225, 1
  %227 = icmp ne i64 %226, 0
  br i1 %227, label %228, label %234

228:                                              ; preds = %222
  %229 = call double @gk_CPUSeconds()
  %230 = load ptr, ptr %3, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.controldef, ptr %230, i32 0, i32 16
  %232 = load double, ptr %231, align 8, !tbaa !15
  %233 = fadd double %232, %229
  store double %233, ptr %231, align 8, !tbaa !15
  br label %234

234:                                              ; preds = %228, %222
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret ptr %235
}

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

declare double @gk_CPUSeconds() #2

declare i32 @mprintf(ptr noundef, ...) #2

declare i64 @libmetis__idxsum(i64 noundef, ptr noundef, i64 noundef) #2

declare float @gk_fsum(i64 noundef, ptr noundef, i64 noundef) #2

declare void @libmetis__MCMatch_RM(ptr noundef, ptr noundef) #2

declare void @libmetis__MCMatch_HEM(ptr noundef, ptr noundef) #2

declare void @libmetis__MCMatch_SHEM(ptr noundef, ptr noundef) #2

declare void @libmetis__MCMatch_SHEBM(ptr noundef, ptr noundef, i64 noundef) #2

declare void @libmetis__MCMatch_SBHEM(ptr noundef, ptr noundef, i64 noundef) #2

declare void @errexit(ptr noundef, ...) #2

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

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 = { "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 }

!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, !11, i64 8}
!10 = !{!"controldef", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !13, i64 88, !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, !14, i64 232, !14, i64 240, !14, i64 248, !14, i64 256, !14, i64 264, !14, i64 272}
!11 = !{!"long", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"workspacedef", !6, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !6, i64 56}
!14 = !{!"double", !7, i64 0}
!15 = !{!10, !14, i64 184}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !11, i64 0}
!18 = !{!"graphdef", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !19, i64 56, !19, i64 60, !19, i64 64, !19, i64 68, !19, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 120, !6, i64 128, !6, i64 136, !11, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !11, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240}
!19 = !{!"int", !7, i64 0}
!20 = !{!18, !11, i64 8}
!21 = !{!18, !6, i64 88}
!22 = !{!10, !11, i64 0}
!23 = !{!10, !12, i64 48}
!24 = !{!18, !11, i64 208}
!25 = !{!18, !6, i64 216}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!10, !11, i64 16}
!29 = !{!18, !6, i64 232}
!30 = !{!18, !6, i64 240}
!31 = distinct !{!31, !27}
!32 = distinct !{!32, !27}


; 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 [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

11:                                               ; preds = %6, %2
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = getelementptr inbounds i8, ptr %1, i64 208
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  br label %15

15:                                               ; preds = %82, %11
  %.068 = phi i64 [ 0, %11 ], [ %70, %82 ]
  %.0 = phi ptr [ %1, %11 ], [ %69, %82 ]
  %16 = load i64, ptr %3, align 8, !tbaa !5
  %17 = and i64 %16, 4
  %.not71 = icmp eq i64 %17, 0
  br i1 %.not71, label %45, label %18

18:                                               ; preds = %15
  %19 = load i64, ptr %.0, align 8, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %.0, i64 8
  %21 = load i64, ptr %20, align 8, !tbaa !18
  %22 = getelementptr inbounds i8, ptr %.0, i64 88
  %23 = load ptr, ptr %22, align 8, !tbaa !19
  %24 = tail call i64 @libmetis__idxsum(i64 noundef %19, ptr noundef %23, i64 noundef 1) #2
  %25 = load i64, ptr %0, align 8, !tbaa !20
  %26 = load float, ptr %12, align 8, !tbaa !21
  %27 = fpext float %26 to double
  %28 = tail call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str, i64 noundef %19, i64 noundef %21, i64 noundef %24, i64 noundef %25, double noundef %27) #2
  %29 = load i64, ptr %13, align 8, !tbaa !22
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18
  %31 = getelementptr inbounds i8, ptr %.0, i64 216
  %32 = getelementptr inbounds i8, ptr %.0, i64 208
  br label %33

33:                                               ; preds = %.lr.ph, %33
  %.06975 = phi i64 [ 0, %.lr.ph ], [ %41, %33 ]
  %34 = load i64, ptr %.0, align 8, !tbaa !15
  %35 = load ptr, ptr %31, align 8, !tbaa !23
  %36 = getelementptr inbounds float, ptr %35, i64 %.06975
  %37 = load i64, ptr %32, align 8, !tbaa !22
  %38 = tail call float @gk_fsum(i64 noundef %34, ptr noundef %36, i64 noundef %37) #2
  %39 = fpext float %38 to double
  %40 = tail call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str.1, double noundef %39) #2
  %41 = add nuw nsw i64 %.06975, 1
  %42 = load i64, ptr %13, align 8, !tbaa !22
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %33, label %._crit_edge, !llvm.loop !24

._crit_edge:                                      ; preds = %33, %18
  %44 = tail call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str.2) #2
  br label %45

45:                                               ; preds = %._crit_edge, %15
  %46 = getelementptr inbounds i8, ptr %.0, i64 8
  %47 = load i64, ptr %46, align 8, !tbaa !18
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %45
  tail call void @libmetis__MCMatch_RM(ptr noundef %0, ptr noundef nonnull %.0) #2
  br label %67

50:                                               ; preds = %45
  %51 = load i64, ptr %14, align 8, !tbaa !26
  switch i64 %51, label %66 [
    i64 1, label %52
    i64 2, label %53
    i64 3, label %57
    i64 4, label %61
    i64 5, label %62
    i64 6, label %63
    i64 7, label %64
    i64 8, label %65
  ]

52:                                               ; preds = %50
  tail call void @libmetis__MCMatch_RM(ptr noundef nonnull %0, ptr noundef nonnull %.0) #2
  br label %67

53:                                               ; preds = %50
  %54 = icmp eq i64 %.068, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %53
  tail call void @libmetis__MCMatch_RM(ptr noundef nonnull %0, ptr noundef nonnull %.0) #2
  br label %67

56:                                               ; preds = %53
  tail call void @libmetis__MCMatch_HEM(ptr noundef nonnull %0, ptr noundef nonnull %.0) #2
  br label %67

57:                                               ; preds = %50
  %58 = icmp eq i64 %.068, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %57
  tail call void @libmetis__MCMatch_RM(ptr noundef nonnull %0, ptr noundef nonnull %.0) #2
  br label %67

60:                                               ; preds = %57
  tail call void @libmetis__MCMatch_SHEM(ptr noundef nonnull %0, ptr noundef nonnull %.0) #2
  br label %67

61:                                               ; preds = %50
  tail call void @libmetis__MCMatch_SHEM(ptr noundef nonnull %0, ptr noundef nonnull %.0) #2
  br label %67

62:                                               ; preds = %50
  tail call void @libmetis__MCMatch_SHEBM(ptr noundef nonnull %0, ptr noundef nonnull %.0, i64 noundef 1) #2
  br label %67

63:                                               ; preds = %50
  tail call void @libmetis__MCMatch_SHEBM(ptr noundef nonnull %0, ptr noundef nonnull %.0, i64 noundef -1) #2
  br label %67

64:                                               ; preds = %50
  tail call void @libmetis__MCMatch_SBHEM(ptr noundef nonnull %0, ptr noundef nonnull %.0, i64 noundef 1) #2
  br label %67

65:                                               ; preds = %50
  tail call void @libmetis__MCMatch_SBHEM(ptr noundef nonnull %0, ptr noundef nonnull %.0, i64 noundef -1) #2
  br label %67

66:                                               ; preds = %50
  tail call void (ptr, ...) @errexit(ptr noundef nonnull @.str.3, i64 noundef %51) #2
  br label %67

67:                                               ; preds = %52, %61, %62, %63, %64, %65, %66, %56, %55, %60, %59, %49
  %68 = getelementptr inbounds i8, ptr %.0, i64 232
  %69 = load ptr, ptr %68, align 8, !tbaa !27
  %70 = add nuw nsw i64 %.068, 1
  %71 = load i64, ptr %69, align 8, !tbaa !15
  %72 = load i64, ptr %0, align 8, !tbaa !20
  %73 = icmp sgt i64 %71, %72
  br i1 %73, label %74, label %.critedge

74:                                               ; preds = %67
  %75 = sitofp i64 %71 to double
  %76 = getelementptr inbounds i8, ptr %69, i64 240
  %77 = load ptr, ptr %76, align 8, !tbaa !28
  %78 = load i64, ptr %77, align 8, !tbaa !15
  %79 = sitofp i64 %78 to double
  %80 = fmul double %79, 0x3FEFAE147AE147AE
  %81 = fcmp ogt double %80, %75
  br i1 %81, label %82, label %.critedge

82:                                               ; preds = %74
  %83 = getelementptr inbounds i8, ptr %69, i64 8
  %84 = load i64, ptr %83, align 8, !tbaa !18
  %85 = sdiv i64 %71, 2
  %86 = icmp sgt i64 %84, %85
  br i1 %86, label %15, label %.critedge, !llvm.loop !29

.critedge:                                        ; preds = %74, %67, %82
  %87 = load i64, ptr %3, align 8, !tbaa !5
  %88 = and i64 %87, 4
  %.not72 = icmp eq i64 %88, 0
  br i1 %.not72, label %115, label %89

89:                                               ; preds = %.critedge
  %90 = getelementptr inbounds i8, ptr %69, i64 8
  %91 = load i64, ptr %90, align 8, !tbaa !18
  %92 = getelementptr inbounds i8, ptr %69, i64 88
  %93 = load ptr, ptr %92, align 8, !tbaa !19
  %94 = tail call i64 @libmetis__idxsum(i64 noundef %71, ptr noundef %93, i64 noundef 1) #2
  %95 = load i64, ptr %0, align 8, !tbaa !20
  %96 = load float, ptr %12, align 8, !tbaa !21
  %97 = fpext float %96 to double
  %98 = tail call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str, i64 noundef %71, i64 noundef %91, i64 noundef %94, i64 noundef %95, double noundef %97) #2
  %99 = load i64, ptr %13, align 8, !tbaa !22
  %100 = icmp sgt i64 %99, 0
  br i1 %100, label %.lr.ph78, label %._crit_edge79

.lr.ph78:                                         ; preds = %89
  %101 = getelementptr inbounds i8, ptr %69, i64 216
  %102 = getelementptr inbounds i8, ptr %69, i64 208
  br label %103

103:                                              ; preds = %.lr.ph78, %103
  %.176 = phi i64 [ 0, %.lr.ph78 ], [ %111, %103 ]
  %104 = load i64, ptr %69, align 8, !tbaa !15
  %105 = load ptr, ptr %101, align 8, !tbaa !23
  %106 = getelementptr inbounds float, ptr %105, i64 %.176
  %107 = load i64, ptr %102, align 8, !tbaa !22
  %108 = tail call float @gk_fsum(i64 noundef %104, ptr noundef %106, i64 noundef %107) #2
  %109 = fpext float %108 to double
  %110 = tail call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str.1, double noundef %109) #2
  %111 = add nuw nsw i64 %.176, 1
  %112 = load i64, ptr %13, align 8, !tbaa !22
  %113 = icmp slt i64 %111, %112
  br i1 %113, label %103, label %._crit_edge79, !llvm.loop !30

._crit_edge79:                                    ; preds = %103, %89
  %114 = tail call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str.2) #2
  %.pre = load i64, ptr %3, align 8, !tbaa !5
  br label %115

115:                                              ; preds = %._crit_edge79, %.critedge
  %116 = phi i64 [ %.pre, %._crit_edge79 ], [ %87, %.critedge ]
  %117 = and i64 %116, 1
  %.not73 = icmp eq i64 %117, 0
  br i1 %.not73, label %123, label %118

118:                                              ; preds = %115
  %119 = tail call double @gk_CPUSeconds() #2
  %120 = getelementptr inbounds i8, ptr %0, i64 184
  %121 = load double, ptr %120, align 8, !tbaa !14
  %122 = fadd double %119, %121
  store double %122, ptr %120, align 8, !tbaa !14
  br label %123

123:                                              ; preds = %118, %115
  ret ptr %69
}

declare double @gk_CPUSeconds() local_unnamed_addr #1

declare i32 @mprintf(ptr noundef, ...) local_unnamed_addr #1

declare i64 @libmetis__idxsum(i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare float @gk_fsum(i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @libmetis__MCMatch_RM(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @libmetis__MCMatch_HEM(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @libmetis__MCMatch_SHEM(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @libmetis__MCMatch_SHEBM(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @libmetis__MCMatch_SBHEM(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @errexit(ptr noundef, ...) local_unnamed_addr #1

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 = { "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 }

!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 = !{!"controldef", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !11, i64 88, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !13, i64 272}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"workspacedef", !12, i64 0, !7, i64 8, !7, i64 16, !12, i64 24, !12, i64 32, !7, i64 40, !12, i64 48, !12, i64 56}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!6, !13, i64 184}
!15 = !{!16, !7, i64 0}
!16 = !{!"graphdef", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !17, i64 56, !17, i64 60, !17, i64 64, !17, i64 68, !17, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !7, i64 112, !7, i64 120, !12, i64 128, !12, i64 136, !7, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !7, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240}
!17 = !{!"int", !8, i64 0}
!18 = !{!16, !7, i64 8}
!19 = !{!16, !12, i64 88}
!20 = !{!6, !7, i64 0}
!21 = !{!6, !10, i64 48}
!22 = !{!16, !7, i64 208}
!23 = !{!16, !12, i64 216}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!6, !7, i64 16}
!27 = !{!16, !12, i64 232}
!28 = !{!16, !12, i64 240}
!29 = distinct !{!29, !25}
!30 = distinct !{!30, !25}


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