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

; 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.params_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, float, float, float, i64 }
%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 [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [346 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [75 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ReadGraph(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca [256 x i8], align 16
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store i64 0, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.params_t, ptr %27, i32 0, i32 22
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = call i32 @gk_fexists(ptr noundef %29)
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %36, label %32

32:                                               ; preds = %1
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.params_t, ptr %33, i32 0, i32 22
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  call void (ptr, ...) @errexit(ptr noundef @.str, ptr noundef %35)
  br label %36

36:                                               ; preds = %32, %1
  %37 = call ptr @libmetis__CreateGraph()
  store ptr %37, ptr %26, align 8, !tbaa !5
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.params_t, ptr %38, i32 0, i32 22
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = call ptr @gk_fopen(ptr noundef %40, ptr noundef @.str.1, ptr noundef @.str.2)
  store ptr %41, ptr %25, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %51, %36
  %43 = load ptr, ptr %25, align 8, !tbaa !5
  %44 = call i64 @gk_getline(ptr noundef %20, ptr noundef %24, ptr noundef %43)
  %45 = icmp eq i64 %44, -1
  br i1 %45, label %46, label %50

46:                                               ; preds = %42
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.params_t, ptr %47, i32 0, i32 22
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  call void (ptr, ...) @errexit(ptr noundef @.str.3, ptr noundef %49)
  br label %50

50:                                               ; preds = %46, %42
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %20, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 0
  %54 = load i8, ptr %53, align 1, !tbaa !15
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 37
  br i1 %56, label %42, label %57, !llvm.loop !16

57:                                               ; preds = %51
  store i32 0, ptr %8, align 4, !tbaa !18
  store i32 0, ptr %7, align 4, !tbaa !18
  %58 = load ptr, ptr %20, align 8, !tbaa !5
  %59 = load ptr, ptr %26, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.graph_t, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %26, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.graph_t, ptr %61, i32 0, i32 1
  %63 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %58, ptr noundef @.str.4, ptr noundef %60, ptr noundef %62, ptr noundef %7, ptr noundef %8) #5
  store i32 %63, ptr %9, align 4, !tbaa !18
  %64 = load i32, ptr %9, align 4, !tbaa !18
  %65 = icmp slt i32 %64, 2
  br i1 %65, label %66, label %67

66:                                               ; preds = %57
  call void (ptr, ...) @errexit(ptr noundef @.str.5)
  br label %67

67:                                               ; preds = %66, %57
  %68 = load ptr, ptr %26, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.graph_t, ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !19
  %71 = icmp sle i32 %70, 0
  br i1 %71, label %77, label %72

72:                                               ; preds = %67
  %73 = load ptr, ptr %26, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.graph_t, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !21
  %76 = icmp sle i32 %75, 0
  br i1 %76, label %77, label %84

77:                                               ; preds = %72, %67
  %78 = load ptr, ptr %26, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.graph_t, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !19
  %81 = load ptr, ptr %26, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.graph_t, ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 4, !tbaa !21
  call void (ptr, ...) @errexit(ptr noundef @.str.6, i32 noundef %80, i32 noundef %83)
  br label %84

84:                                               ; preds = %77, %72
  %85 = load i32, ptr %7, align 4, !tbaa !18
  %86 = icmp sgt i32 %85, 111
  br i1 %86, label %87, label %89

87:                                               ; preds = %84
  %88 = load i32, ptr %7, align 4, !tbaa !18
  call void (ptr, ...) @errexit(ptr noundef @.str.7, i32 noundef %88)
  br label %89

89:                                               ; preds = %87, %84
  %90 = getelementptr inbounds [256 x i8], ptr %21, i64 0, i64 0
  %91 = load i32, ptr %7, align 4, !tbaa !18
  %92 = srem i32 %91, 1000
  %93 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %90, ptr noundef @.str.8, i32 noundef %92) #5
  %94 = getelementptr inbounds [256 x i8], ptr %21, i64 0, i64 0
  %95 = load i8, ptr %94, align 16, !tbaa !15
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 49
  %98 = zext i1 %97 to i32
  store i32 %98, ptr %12, align 4, !tbaa !18
  %99 = getelementptr inbounds [256 x i8], ptr %21, i64 0, i64 1
  %100 = load i8, ptr %99, align 1, !tbaa !15
  %101 = sext i8 %100 to i32
  %102 = icmp eq i32 %101, 49
  %103 = zext i1 %102 to i32
  store i32 %103, ptr %11, align 4, !tbaa !18
  %104 = getelementptr inbounds [256 x i8], ptr %21, i64 0, i64 2
  %105 = load i8, ptr %104, align 2, !tbaa !15
  %106 = sext i8 %105 to i32
  %107 = icmp eq i32 %106, 49
  %108 = zext i1 %107 to i32
  store i32 %108, ptr %10, align 4, !tbaa !18
  %109 = load i32, ptr %8, align 4, !tbaa !18
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %111, label %116

111:                                              ; preds = %89
  %112 = load i32, ptr %11, align 4, !tbaa !18
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %116, label %114

114:                                              ; preds = %111
  %115 = load i32, ptr %8, align 4, !tbaa !18
  call void (ptr, ...) @errexit(ptr noundef @.str.9, i32 noundef %115)
  br label %116

116:                                              ; preds = %114, %111, %89
  %117 = load ptr, ptr %26, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.graph_t, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !21
  %120 = mul nsw i32 %119, 2
  store i32 %120, ptr %118, align 4, !tbaa !21
  %121 = load i32, ptr %8, align 4, !tbaa !18
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %124

123:                                              ; preds = %116
  br label %126

124:                                              ; preds = %116
  %125 = load i32, ptr %8, align 4, !tbaa !18
  br label %126

126:                                              ; preds = %124, %123
  %127 = phi i32 [ 1, %123 ], [ %125, %124 ]
  %128 = load ptr, ptr %26, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.graph_t, ptr %128, i32 0, i32 2
  store i32 %127, ptr %129, align 8, !tbaa !22
  store i32 %127, ptr %8, align 4, !tbaa !18
  %130 = load ptr, ptr %26, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.graph_t, ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 8, !tbaa !19
  %133 = add nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = call ptr @libmetis__ismalloc(i64 noundef %134, i32 noundef 0, ptr noundef @.str.10)
  %136 = load ptr, ptr %26, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.graph_t, ptr %136, i32 0, i32 3
  store ptr %135, ptr %137, align 8, !tbaa !23
  store ptr %135, ptr %15, align 8, !tbaa !5
  %138 = load ptr, ptr %26, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.graph_t, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !21
  %141 = sext i32 %140 to i64
  %142 = call ptr @libmetis__imalloc(i64 noundef %141, ptr noundef @.str.11)
  %143 = load ptr, ptr %26, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.graph_t, ptr %143, i32 0, i32 6
  store ptr %142, ptr %144, align 8, !tbaa !24
  store ptr %142, ptr %16, align 8, !tbaa !5
  %145 = load i32, ptr %8, align 4, !tbaa !18
  %146 = load ptr, ptr %26, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.graph_t, ptr %146, i32 0, i32 0
  %148 = load i32, ptr %147, align 8, !tbaa !19
  %149 = mul nsw i32 %145, %148
  %150 = sext i32 %149 to i64
  %151 = call ptr @libmetis__ismalloc(i64 noundef %150, i32 noundef 1, ptr noundef @.str.12)
  %152 = load ptr, ptr %26, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.graph_t, ptr %152, i32 0, i32 4
  store ptr %151, ptr %153, align 8, !tbaa !25
  store ptr %151, ptr %17, align 8, !tbaa !5
  %154 = load ptr, ptr %26, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.graph_t, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 4, !tbaa !21
  %157 = sext i32 %156 to i64
  %158 = call ptr @libmetis__ismalloc(i64 noundef %157, i32 noundef 1, ptr noundef @.str.13)
  %159 = load ptr, ptr %26, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.graph_t, ptr %159, i32 0, i32 7
  store ptr %158, ptr %160, align 8, !tbaa !26
  store ptr %158, ptr %18, align 8, !tbaa !5
  %161 = load ptr, ptr %26, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.graph_t, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !19
  %164 = sext i32 %163 to i64
  %165 = call ptr @libmetis__ismalloc(i64 noundef %164, i32 noundef 1, ptr noundef @.str.14)
  %166 = load ptr, ptr %26, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.graph_t, ptr %166, i32 0, i32 5
  store ptr %165, ptr %167, align 8, !tbaa !27
  store ptr %165, ptr %19, align 8, !tbaa !5
  %168 = load ptr, ptr %15, align 8, !tbaa !5
  %169 = getelementptr inbounds i32, ptr %168, i64 0
  store i32 0, ptr %169, align 4, !tbaa !18
  store i32 0, ptr %5, align 4, !tbaa !18
  store i32 0, ptr %3, align 4, !tbaa !18
  br label %170

170:                                              ; preds = %348, %126
  %171 = load i32, ptr %3, align 4, !tbaa !18
  %172 = load ptr, ptr %26, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.graph_t, ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 8, !tbaa !19
  %175 = icmp slt i32 %171, %174
  br i1 %175, label %176, label %351

176:                                              ; preds = %170
  br label %177

177:                                              ; preds = %185, %176
  %178 = load ptr, ptr %25, align 8, !tbaa !5
  %179 = call i64 @gk_getline(ptr noundef %20, ptr noundef %24, ptr noundef %178)
  %180 = icmp eq i64 %179, -1
  br i1 %180, label %181, label %184

181:                                              ; preds = %177
  %182 = load i32, ptr %3, align 4, !tbaa !18
  %183 = add nsw i32 %182, 1
  call void (ptr, ...) @errexit(ptr noundef @.str.15, i32 noundef %183)
  br label %184

184:                                              ; preds = %181, %177
  br label %185

185:                                              ; preds = %184
  %186 = load ptr, ptr %20, align 8, !tbaa !5
  %187 = getelementptr inbounds i8, ptr %186, i64 0
  %188 = load i8, ptr %187, align 1, !tbaa !15
  %189 = sext i8 %188 to i32
  %190 = icmp eq i32 %189, 37
  br i1 %190, label %177, label %191, !llvm.loop !28

191:                                              ; preds = %185
  %192 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %192, ptr %22, align 8, !tbaa !5
  store ptr null, ptr %23, align 8, !tbaa !5
  %193 = load i32, ptr %12, align 4, !tbaa !18
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %221

195:                                              ; preds = %191
  %196 = load ptr, ptr %22, align 8, !tbaa !5
  %197 = call i64 @strtol(ptr noundef %196, ptr noundef %23, i32 noundef 10) #5
  %198 = trunc i64 %197 to i32
  %199 = load ptr, ptr %19, align 8, !tbaa !5
  %200 = load i32, ptr %3, align 4, !tbaa !18
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds i32, ptr %199, i64 %201
  store i32 %198, ptr %202, align 4, !tbaa !18
  %203 = load ptr, ptr %23, align 8, !tbaa !5
  %204 = load ptr, ptr %22, align 8, !tbaa !5
  %205 = icmp eq ptr %203, %204
  br i1 %205, label %206, label %209

206:                                              ; preds = %195
  %207 = load i32, ptr %3, align 4, !tbaa !18
  %208 = add nsw i32 %207, 1
  call void (ptr, ...) @errexit(ptr noundef @.str.16, i32 noundef %208)
  br label %209

209:                                              ; preds = %206, %195
  %210 = load ptr, ptr %19, align 8, !tbaa !5
  %211 = load i32, ptr %3, align 4, !tbaa !18
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds i32, ptr %210, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !18
  %215 = icmp slt i32 %214, 0
  br i1 %215, label %216, label %219

216:                                              ; preds = %209
  %217 = load i32, ptr %3, align 4, !tbaa !18
  %218 = add nsw i32 %217, 1
  call void (ptr, ...) @errexit(ptr noundef @.str.17, i32 noundef %218)
  br label %219

219:                                              ; preds = %216, %209
  %220 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %220, ptr %22, align 8, !tbaa !5
  br label %221

221:                                              ; preds = %219, %191
  %222 = load i32, ptr %11, align 4, !tbaa !18
  %223 = icmp ne i32 %222, 0
  br i1 %223, label %224, label %269

224:                                              ; preds = %221
  store i32 0, ptr %6, align 4, !tbaa !18
  br label %225

225:                                              ; preds = %265, %224
  %226 = load i32, ptr %6, align 4, !tbaa !18
  %227 = load i32, ptr %8, align 4, !tbaa !18
  %228 = icmp slt i32 %226, %227
  br i1 %228, label %229, label %268

229:                                              ; preds = %225
  %230 = load ptr, ptr %22, align 8, !tbaa !5
  %231 = call i64 @strtol(ptr noundef %230, ptr noundef %23, i32 noundef 10) #5
  %232 = trunc i64 %231 to i32
  %233 = load ptr, ptr %17, align 8, !tbaa !5
  %234 = load i32, ptr %3, align 4, !tbaa !18
  %235 = load i32, ptr %8, align 4, !tbaa !18
  %236 = mul nsw i32 %234, %235
  %237 = load i32, ptr %6, align 4, !tbaa !18
  %238 = add nsw i32 %236, %237
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds i32, ptr %233, i64 %239
  store i32 %232, ptr %240, align 4, !tbaa !18
  %241 = load ptr, ptr %23, align 8, !tbaa !5
  %242 = load ptr, ptr %22, align 8, !tbaa !5
  %243 = icmp eq ptr %241, %242
  br i1 %243, label %244, label %248

244:                                              ; preds = %229
  %245 = load i32, ptr %3, align 4, !tbaa !18
  %246 = add nsw i32 %245, 1
  %247 = load i32, ptr %8, align 4, !tbaa !18
  call void (ptr, ...) @errexit(ptr noundef @.str.18, i32 noundef %246, i32 noundef %247)
  br label %248

248:                                              ; preds = %244, %229
  %249 = load ptr, ptr %17, align 8, !tbaa !5
  %250 = load i32, ptr %3, align 4, !tbaa !18
  %251 = load i32, ptr %8, align 4, !tbaa !18
  %252 = mul nsw i32 %250, %251
  %253 = load i32, ptr %6, align 4, !tbaa !18
  %254 = add nsw i32 %252, %253
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds i32, ptr %249, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !18
  %258 = icmp slt i32 %257, 0
  br i1 %258, label %259, label %263

259:                                              ; preds = %248
  %260 = load i32, ptr %3, align 4, !tbaa !18
  %261 = add nsw i32 %260, 1
  %262 = load i32, ptr %6, align 4, !tbaa !18
  call void (ptr, ...) @errexit(ptr noundef @.str.19, i32 noundef %261, i32 noundef %262)
  br label %263

263:                                              ; preds = %259, %248
  %264 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %264, ptr %22, align 8, !tbaa !5
  br label %265

265:                                              ; preds = %263
  %266 = load i32, ptr %6, align 4, !tbaa !18
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %6, align 4, !tbaa !18
  br label %225, !llvm.loop !29

268:                                              ; preds = %225
  br label %269

269:                                              ; preds = %268, %221
  br label %270

270:                                              ; preds = %327, %269
  br label %271

271:                                              ; preds = %270
  %272 = load ptr, ptr %22, align 8, !tbaa !5
  %273 = call i64 @strtol(ptr noundef %272, ptr noundef %23, i32 noundef 10) #5
  %274 = trunc i64 %273 to i32
  store i32 %274, ptr %13, align 4, !tbaa !18
  %275 = load ptr, ptr %23, align 8, !tbaa !5
  %276 = load ptr, ptr %22, align 8, !tbaa !5
  %277 = icmp eq ptr %275, %276
  br i1 %277, label %278, label %279

278:                                              ; preds = %271
  br label %341

279:                                              ; preds = %271
  %280 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %280, ptr %22, align 8, !tbaa !5
  %281 = load i32, ptr %13, align 4, !tbaa !18
  %282 = icmp slt i32 %281, 1
  br i1 %282, label %289, label %283

283:                                              ; preds = %279
  %284 = load i32, ptr %13, align 4, !tbaa !18
  %285 = load ptr, ptr %26, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.graph_t, ptr %285, i32 0, i32 0
  %287 = load i32, ptr %286, align 8, !tbaa !19
  %288 = icmp sgt i32 %284, %287
  br i1 %288, label %289, label %293

289:                                              ; preds = %283, %279
  %290 = load i32, ptr %13, align 4, !tbaa !18
  %291 = load i32, ptr %3, align 4, !tbaa !18
  %292 = add nsw i32 %291, 1
  call void (ptr, ...) @errexit(ptr noundef @.str.20, i32 noundef %290, i32 noundef %292)
  br label %293

293:                                              ; preds = %289, %283
  store i32 1, ptr %14, align 4, !tbaa !18
  %294 = load i32, ptr %10, align 4, !tbaa !18
  %295 = icmp ne i32 %294, 0
  br i1 %295, label %296, label %316

296:                                              ; preds = %293
  %297 = load ptr, ptr %22, align 8, !tbaa !5
  %298 = call i64 @strtol(ptr noundef %297, ptr noundef %23, i32 noundef 10) #5
  %299 = trunc i64 %298 to i32
  store i32 %299, ptr %14, align 4, !tbaa !18
  %300 = load ptr, ptr %23, align 8, !tbaa !5
  %301 = load ptr, ptr %22, align 8, !tbaa !5
  %302 = icmp eq ptr %300, %301
  br i1 %302, label %303, label %306

303:                                              ; preds = %296
  %304 = load i32, ptr %3, align 4, !tbaa !18
  %305 = add nsw i32 %304, 1
  call void (ptr, ...) @errexit(ptr noundef @.str.21, i32 noundef %305)
  br label %306

306:                                              ; preds = %303, %296
  %307 = load i32, ptr %14, align 4, !tbaa !18
  %308 = icmp sle i32 %307, 0
  br i1 %308, label %309, label %314

309:                                              ; preds = %306
  %310 = load i32, ptr %14, align 4, !tbaa !18
  %311 = load i32, ptr %3, align 4, !tbaa !18
  %312 = add nsw i32 %311, 1
  %313 = load i32, ptr %13, align 4, !tbaa !18
  call void (ptr, ...) @errexit(ptr noundef @.str.22, i32 noundef %310, i32 noundef %312, i32 noundef %313)
  br label %314

314:                                              ; preds = %309, %306
  %315 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %315, ptr %22, align 8, !tbaa !5
  br label %316

316:                                              ; preds = %314, %293
  %317 = load i32, ptr %5, align 4, !tbaa !18
  %318 = load ptr, ptr %26, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.graph_t, ptr %318, i32 0, i32 1
  %320 = load i32, ptr %319, align 4, !tbaa !21
  %321 = icmp eq i32 %317, %320
  br i1 %321, label %322, label %327

322:                                              ; preds = %316
  %323 = load ptr, ptr %26, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.graph_t, ptr %323, i32 0, i32 1
  %325 = load i32, ptr %324, align 4, !tbaa !21
  %326 = sdiv i32 %325, 2
  call void (ptr, ...) @errexit(ptr noundef @.str.23, i32 noundef %326)
  br label %327

327:                                              ; preds = %322, %316
  %328 = load i32, ptr %13, align 4, !tbaa !18
  %329 = sub nsw i32 %328, 1
  %330 = load ptr, ptr %16, align 8, !tbaa !5
  %331 = load i32, ptr %5, align 4, !tbaa !18
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds i32, ptr %330, i64 %332
  store i32 %329, ptr %333, align 4, !tbaa !18
  %334 = load i32, ptr %14, align 4, !tbaa !18
  %335 = load ptr, ptr %18, align 8, !tbaa !5
  %336 = load i32, ptr %5, align 4, !tbaa !18
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds i32, ptr %335, i64 %337
  store i32 %334, ptr %338, align 4, !tbaa !18
  %339 = load i32, ptr %5, align 4, !tbaa !18
  %340 = add nsw i32 %339, 1
  store i32 %340, ptr %5, align 4, !tbaa !18
  br label %270

341:                                              ; preds = %278
  %342 = load i32, ptr %5, align 4, !tbaa !18
  %343 = load ptr, ptr %15, align 8, !tbaa !5
  %344 = load i32, ptr %3, align 4, !tbaa !18
  %345 = add nsw i32 %344, 1
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds i32, ptr %343, i64 %346
  store i32 %342, ptr %347, align 4, !tbaa !18
  br label %348

348:                                              ; preds = %341
  %349 = load i32, ptr %3, align 4, !tbaa !18
  %350 = add nsw i32 %349, 1
  store i32 %350, ptr %3, align 4, !tbaa !18
  br label %170, !llvm.loop !30

351:                                              ; preds = %170
  %352 = load ptr, ptr %25, align 8, !tbaa !5
  call void @gk_fclose(ptr noundef %352)
  %353 = load i32, ptr %5, align 4, !tbaa !18
  %354 = load ptr, ptr %26, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.graph_t, ptr %354, i32 0, i32 1
  %356 = load i32, ptr %355, align 4, !tbaa !21
  %357 = icmp ne i32 %353, %356
  br i1 %357, label %358, label %381

358:                                              ; preds = %351
  %359 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %360 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %361 = load ptr, ptr %26, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.graph_t, ptr %361, i32 0, i32 1
  %363 = load i32, ptr %362, align 4, !tbaa !21
  %364 = sdiv i32 %363, 2
  %365 = load i32, ptr %5, align 4, !tbaa !18
  %366 = sdiv i32 %365, 2
  %367 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, i32 noundef %364, i32 noundef %366)
  %368 = load i32, ptr %5, align 4, !tbaa !18
  %369 = mul nsw i32 2, %368
  %370 = load ptr, ptr %26, align 8, !tbaa !5
  %371 = getelementptr inbounds %struct.graph_t, ptr %370, i32 0, i32 1
  %372 = load i32, ptr %371, align 4, !tbaa !21
  %373 = icmp eq i32 %369, %372
  br i1 %373, label %374, label %378

374:                                              ; preds = %358
  %375 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  %376 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  %377 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  br label %378

378:                                              ; preds = %374, %358
  %379 = call i32 (ptr, ...) @printf(ptr noundef @.str.30)
  %380 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  call void @exit(i32 noundef 0) #6
  unreachable

381:                                              ; preds = %351
  call void (ptr, ...) @gk_free(ptr noundef %20, ptr noundef null)
  %382 = load ptr, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret ptr %382
}

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

declare i32 @gk_fexists(ptr noundef) #2

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

declare ptr @libmetis__CreateGraph() #2

declare ptr @gk_fopen(ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @libmetis__ismalloc(i64 noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: nounwind
declare i64 @strtol(ptr noundef, ptr noundef, i32 noundef) #3

declare void @gk_fclose(ptr noundef) #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

declare void @gk_free(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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 88}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !13, i64 132, !6, i64 136, !6, i64 144, !14, i64 152, !14, i64 156, !14, i64 160, !10, i64 168}
!13 = !{!"int", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!13, !13, i64 0}
!19 = !{!20, !13, i64 0}
!20 = !{!"graph_t", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !6, i64 96, !6, i64 104, !13, i64 112, !13, i64 116, !6, i64 120, !6, i64 128, !13, 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}
!21 = !{!20, !13, i64 4}
!22 = !{!20, !13, i64 8}
!23 = !{!20, !6, i64 16}
!24 = !{!20, !6, i64 40}
!25 = !{!20, !6, i64 24}
!26 = !{!20, !6, i64 48}
!27 = !{!20, !6, i64 32}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}
!30 = distinct !{!30, !17}


; 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 [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [346 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [75 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ReadGraph(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca [256 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store i64 0, ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %0, i64 88
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  %10 = tail call i32 @gk_fexists(ptr noundef %9) #7
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %13

11:                                               ; preds = %1
  %12 = load ptr, ptr %8, align 8, !tbaa !11
  tail call void (ptr, ...) @errexit(ptr noundef nonnull @.str, ptr noundef %12) #7
  br label %13

13:                                               ; preds = %11, %1
  %14 = tail call ptr @libmetis__CreateGraph() #7
  %15 = load ptr, ptr %8, align 8, !tbaa !11
  %16 = tail call ptr @gk_fopen(ptr noundef %15, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2) #7
  br label %17

17:                                               ; preds = %22, %13
  %18 = call i64 @gk_getline(ptr noundef nonnull %4, ptr noundef nonnull %7, ptr noundef %16) #7
  %19 = icmp eq i64 %18, -1
  br i1 %19, label %20, label %22

20:                                               ; preds = %17
  %21 = load ptr, ptr %8, align 8, !tbaa !11
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.3, ptr noundef %21) #7
  br label %22

22:                                               ; preds = %17, %20
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = load i8, ptr %23, align 1, !tbaa !15
  %25 = icmp eq i8 %24, 37
  br i1 %25, label %17, label %26, !llvm.loop !16

26:                                               ; preds = %22
  store i32 0, ptr %3, align 4, !tbaa !18
  store i32 0, ptr %2, align 4, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %14, i64 4
  %28 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %23, ptr noundef nonnull @.str.4, ptr noundef %14, ptr noundef nonnull %27, ptr noundef nonnull %2, ptr noundef nonnull %3) #7
  %29 = icmp slt i32 %28, 2
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.5) #7
  br label %31

31:                                               ; preds = %30, %26
  %32 = load i32, ptr %14, align 8, !tbaa !19
  %33 = icmp slt i32 %32, 1
  %.pre = load i32, ptr %27, align 4, !tbaa !21
  %34 = icmp slt i32 %.pre, 1
  %or.cond127 = select i1 %33, i1 true, i1 %34
  br i1 %or.cond127, label %35, label %36

35:                                               ; preds = %31
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.6, i32 noundef %32, i32 noundef %.pre) #7
  br label %36

36:                                               ; preds = %31, %35
  %37 = load i32, ptr %2, align 4, !tbaa !18
  %38 = icmp sgt i32 %37, 111
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.7, i32 noundef %37) #7
  %.pre122 = load i32, ptr %2, align 4, !tbaa !18
  br label %40

40:                                               ; preds = %39, %36
  %41 = phi i32 [ %.pre122, %39 ], [ %37, %36 ]
  %42 = srem i32 %41, 1000
  %43 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %42) #7
  %44 = load i8, ptr %5, align 16, !tbaa !15
  %45 = icmp eq i8 %44, 49
  %46 = getelementptr inbounds i8, ptr %5, i64 1
  %47 = load i8, ptr %46, align 1, !tbaa !15
  %48 = icmp eq i8 %47, 49
  %49 = getelementptr inbounds i8, ptr %5, i64 2
  %50 = load i8, ptr %49, align 2, !tbaa !15
  %51 = icmp eq i8 %50, 49
  %52 = load i32, ptr %3, align 4
  %53 = icmp slt i32 %52, 1
  %or.cond = select i1 %53, i1 true, i1 %48
  br i1 %or.cond, label %55, label %54

54:                                               ; preds = %40
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.9, i32 noundef %52) #7
  %.pre123 = load i32, ptr %3, align 4
  br label %55

55:                                               ; preds = %54, %40
  %56 = phi i32 [ %.pre123, %54 ], [ %52, %40 ]
  %57 = load i32, ptr %27, align 4, !tbaa !21
  %58 = shl nsw i32 %57, 1
  store i32 %58, ptr %27, align 4, !tbaa !21
  %59 = call i32 @llvm.umax.i32(i32 %56, i32 1)
  %60 = getelementptr inbounds i8, ptr %14, i64 8
  store i32 %59, ptr %60, align 8, !tbaa !22
  store i32 %59, ptr %3, align 4, !tbaa !18
  %61 = load i32, ptr %14, align 8, !tbaa !19
  %62 = add nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = call ptr @libmetis__ismalloc(i64 noundef %63, i32 noundef 0, ptr noundef nonnull @.str.10) #7
  %65 = getelementptr inbounds i8, ptr %14, i64 16
  store ptr %64, ptr %65, align 8, !tbaa !23
  %66 = load i32, ptr %27, align 4, !tbaa !21
  %67 = sext i32 %66 to i64
  %68 = call ptr @libmetis__imalloc(i64 noundef %67, ptr noundef nonnull @.str.11) #7
  %69 = getelementptr inbounds i8, ptr %14, i64 40
  store ptr %68, ptr %69, align 8, !tbaa !24
  %70 = load i32, ptr %3, align 4, !tbaa !18
  %71 = load i32, ptr %14, align 8, !tbaa !19
  %72 = mul nsw i32 %71, %70
  %73 = sext i32 %72 to i64
  %74 = call ptr @libmetis__ismalloc(i64 noundef %73, i32 noundef 1, ptr noundef nonnull @.str.12) #7
  %75 = getelementptr inbounds i8, ptr %14, i64 24
  store ptr %74, ptr %75, align 8, !tbaa !25
  %76 = load i32, ptr %27, align 4, !tbaa !21
  %77 = sext i32 %76 to i64
  %78 = call ptr @libmetis__ismalloc(i64 noundef %77, i32 noundef 1, ptr noundef nonnull @.str.13) #7
  %79 = getelementptr inbounds i8, ptr %14, i64 48
  store ptr %78, ptr %79, align 8, !tbaa !26
  %80 = load i32, ptr %14, align 8, !tbaa !19
  %81 = sext i32 %80 to i64
  %82 = call ptr @libmetis__ismalloc(i64 noundef %81, i32 noundef 1, ptr noundef nonnull @.str.14) #7
  %83 = getelementptr inbounds i8, ptr %14, i64 32
  store ptr %82, ptr %83, align 8, !tbaa !27
  store i32 0, ptr %64, align 4, !tbaa !18
  %84 = load i32, ptr %14, align 8, !tbaa !19
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.preheader102, label %._crit_edge111

.preheader102:                                    ; preds = %55, %._crit_edge
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %._crit_edge ], [ 0, %55 ]
  %.090109 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %55 ]
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %86 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  br label %87

87:                                               ; preds = %.preheader102, %91
  %88 = call i64 @gk_getline(ptr noundef nonnull %4, ptr noundef nonnull %7, ptr noundef %16) #7
  %89 = icmp eq i64 %88, -1
  br i1 %89, label %90, label %91

90:                                               ; preds = %87
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.15, i32 noundef %86) #7
  br label %91

91:                                               ; preds = %87, %90
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load i8, ptr %92, align 1, !tbaa !15
  %94 = icmp eq i8 %93, 37
  br i1 %94, label %87, label %95, !llvm.loop !28

95:                                               ; preds = %91
  store ptr null, ptr %6, align 8, !tbaa !5
  br i1 %45, label %96, label %109

96:                                               ; preds = %95
  %97 = call i64 @strtol(ptr noundef nonnull %92, ptr noundef nonnull %6, i32 noundef 10) #7
  %98 = trunc i64 %97 to i32
  %99 = getelementptr inbounds i32, ptr %82, i64 %indvars.iv119
  store i32 %98, ptr %99, align 4, !tbaa !18
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = icmp eq ptr %100, %92
  br i1 %101, label %102, label %104

102:                                              ; preds = %96
  %103 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.16, i32 noundef %103) #7
  %.pr = load i32, ptr %99, align 4, !tbaa !18
  br label %104

104:                                              ; preds = %102, %96
  %105 = phi i32 [ %.pr, %102 ], [ %98, %96 ]
  %106 = icmp slt i32 %105, 0
  br i1 %106, label %107, label %109

107:                                              ; preds = %104
  %108 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.17, i32 noundef %108) #7
  br label %109

109:                                              ; preds = %104, %107, %95
  %.091 = phi ptr [ %92, %95 ], [ %100, %107 ], [ %100, %104 ]
  %110 = load i32, ptr %3, align 4
  %111 = icmp sgt i32 %110, 0
  %or.cond114 = select i1 %48, i1 %111, i1 false
  br i1 %or.cond114, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %109
  %112 = trunc nuw nsw i64 %indvars.iv119 to i32
  %113 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  %114 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  br label %115

115:                                              ; preds = %.lr.ph, %136
  %.192105 = phi ptr [ %.091, %.lr.ph ], [ %123, %136 ]
  %.093104 = phi i32 [ 0, %.lr.ph ], [ %138, %136 ]
  %116 = call i64 @strtol(ptr noundef %.192105, ptr noundef nonnull %6, i32 noundef 10) #7
  %117 = trunc i64 %116 to i32
  %118 = load i32, ptr %3, align 4, !tbaa !18
  %119 = mul nsw i32 %118, %112
  %120 = add nsw i32 %119, %.093104
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i32, ptr %74, i64 %121
  store i32 %117, ptr %122, align 4, !tbaa !18
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = icmp eq ptr %123, %.192105
  br i1 %124, label %125, label %127

125:                                              ; preds = %115
  %126 = load i32, ptr %3, align 4, !tbaa !18
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.18, i32 noundef %113, i32 noundef %126) #7
  br label %127

127:                                              ; preds = %125, %115
  %128 = load i32, ptr %3, align 4, !tbaa !18
  %129 = mul nsw i32 %128, %112
  %130 = add nsw i32 %129, %.093104
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %74, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !18
  %134 = icmp slt i32 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %127
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.19, i32 noundef %114, i32 noundef %.093104) #7
  %.pre124 = load i32, ptr %3, align 4, !tbaa !18
  br label %136

136:                                              ; preds = %135, %127
  %137 = phi i32 [ %.pre124, %135 ], [ %128, %127 ]
  %138 = add nuw nsw i32 %.093104, 1
  %139 = icmp slt i32 %138, %137
  br i1 %139, label %115, label %.loopexit, !llvm.loop !29

.loopexit:                                        ; preds = %136, %109
  %.2 = phi ptr [ %.091, %109 ], [ %123, %136 ]
  %140 = call i64 @strtol(ptr noundef %.2, ptr noundef nonnull %6, i32 noundef 10) #7
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = icmp eq ptr %141, %.2
  br i1 %142, label %._crit_edge, label %.lr.ph107

.lr.ph107:                                        ; preds = %.loopexit
  %143 = sext i32 %.090109 to i64
  %144 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  %145 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  %146 = trunc nuw nsw i64 %indvars.iv.next120 to i32
  br label %147

147:                                              ; preds = %.lr.ph107, %171
  %indvars.iv = phi i64 [ %143, %.lr.ph107 ], [ %indvars.iv.next, %171 ]
  %148 = phi ptr [ %141, %.lr.ph107 ], [ %176, %171 ]
  %.in = phi i64 [ %140, %.lr.ph107 ], [ %175, %171 ]
  %149 = trunc i64 %.in to i32
  %150 = icmp slt i32 %149, 1
  br i1 %150, label %154, label %151

151:                                              ; preds = %147
  %152 = load i32, ptr %14, align 8, !tbaa !19
  %153 = icmp slt i32 %152, %149
  br i1 %153, label %154, label %155

154:                                              ; preds = %151, %147
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.20, i32 noundef %149, i32 noundef %144) #7
  br label %155

155:                                              ; preds = %154, %151
  br i1 %51, label %156, label %165

156:                                              ; preds = %155
  %157 = call i64 @strtol(ptr noundef %148, ptr noundef nonnull %6, i32 noundef 10) #7
  %158 = trunc i64 %157 to i32
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = icmp eq ptr %159, %148
  br i1 %160, label %161, label %162

161:                                              ; preds = %156
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.21, i32 noundef %145) #7
  br label %162

162:                                              ; preds = %161, %156
  %163 = icmp slt i32 %158, 1
  br i1 %163, label %164, label %165

164:                                              ; preds = %162
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.22, i32 noundef %158, i32 noundef %146, i32 noundef %149) #7
  br label %165

165:                                              ; preds = %162, %164, %155
  %.094 = phi i32 [ 1, %155 ], [ %158, %164 ], [ %158, %162 ]
  %.4 = phi ptr [ %148, %155 ], [ %159, %164 ], [ %159, %162 ]
  %166 = load i32, ptr %27, align 4, !tbaa !21
  %167 = trunc nsw i64 %indvars.iv to i32
  %168 = icmp eq i32 %166, %167
  br i1 %168, label %169, label %171

169:                                              ; preds = %165
  %170 = sdiv i32 %166, 2
  call void (ptr, ...) @errexit(ptr noundef nonnull @.str.23, i32 noundef %170) #7
  br label %171

171:                                              ; preds = %169, %165
  %172 = add nsw i32 %149, -1
  %173 = getelementptr inbounds i32, ptr %68, i64 %indvars.iv
  store i32 %172, ptr %173, align 4, !tbaa !18
  %174 = getelementptr inbounds i32, ptr %78, i64 %indvars.iv
  store i32 %.094, ptr %174, align 4, !tbaa !18
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %175 = call i64 @strtol(ptr noundef %.4, ptr noundef nonnull %6, i32 noundef 10) #7
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = icmp eq ptr %176, %.4
  br i1 %177, label %._crit_edge.loopexit, label %147

._crit_edge.loopexit:                             ; preds = %171
  %178 = trunc nsw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.loopexit
  %.1.lcssa = phi i32 [ %.090109, %.loopexit ], [ %178, %._crit_edge.loopexit ]
  %179 = getelementptr inbounds i32, ptr %64, i64 %indvars.iv.next120
  store i32 %.1.lcssa, ptr %179, align 4, !tbaa !18
  %180 = load i32, ptr %14, align 8, !tbaa !19
  %181 = sext i32 %180 to i64
  %182 = icmp slt i64 %indvars.iv.next120, %181
  br i1 %182, label %.preheader102, label %._crit_edge111, !llvm.loop !30

._crit_edge111:                                   ; preds = %._crit_edge, %55
  %.090.lcssa = phi i32 [ 0, %55 ], [ %.1.lcssa, %._crit_edge ]
  call void @gk_fclose(ptr noundef %16) #7
  %183 = load i32, ptr %27, align 4, !tbaa !21
  %.not101 = icmp eq i32 %.090.lcssa, %183
  br i1 %.not101, label %201, label %184

184:                                              ; preds = %._crit_edge111
  %185 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %186 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  %187 = load i32, ptr %27, align 4, !tbaa !21
  %188 = sdiv i32 %187, 2
  %189 = sdiv i32 %.090.lcssa, 2
  %190 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, i32 noundef %188, i32 noundef %189)
  %191 = shl nsw i32 %.090.lcssa, 1
  %192 = load i32, ptr %27, align 4, !tbaa !21
  %193 = icmp eq i32 %191, %192
  br i1 %193, label %194, label %198

194:                                              ; preds = %184
  %195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  %196 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  %197 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  br label %198

198:                                              ; preds = %194, %184
  %199 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30)
  %200 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  call void @exit(i32 noundef 0) #8
  unreachable

201:                                              ; preds = %._crit_edge111
  call void (ptr, ...) @gk_free(ptr noundef nonnull %4, ptr noundef null) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  ret ptr %14
}

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

declare i32 @gk_fexists(ptr noundef) local_unnamed_addr #2

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

declare ptr @libmetis__CreateGraph() local_unnamed_addr #2

declare ptr @gk_fopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @gk_getline(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare ptr @libmetis__ismalloc(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4

declare void @gk_fclose(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

declare void @gk_free(ptr noundef, ...) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #6

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 = { mustprogress 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 = { 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 #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 88}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !13, i64 132, !6, i64 136, !6, i64 144, !14, i64 152, !14, i64 156, !14, i64 160, !10, i64 168}
!13 = !{!"int", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!13, !13, i64 0}
!19 = !{!20, !13, i64 0}
!20 = !{!"graph_t", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !6, i64 96, !6, i64 104, !13, i64 112, !13, i64 116, !6, i64 120, !6, i64 128, !13, 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}
!21 = !{!20, !13, i64 4}
!22 = !{!20, !13, i64 8}
!23 = !{!20, !6, i64 16}
!24 = !{!20, !6, i64 40}
!25 = !{!20, !6, i64 24}
!26 = !{!20, !6, i64 48}
!27 = !{!20, !6, i64 32}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}
!30 = distinct !{!30, !17}


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