; LLVM IR from yourtion/LearningMasteringAlgorithms-C :: Example/graphalg (main)

; 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.EdgeData_ = type { [2 x i8], [2 x i8], double }
%struct.CoordData_ = type { [2 x i8], double, double }
%struct.Graph_ = type { i32, i32, ptr, ptr, %struct.List_ }
%struct.List_ = type { i32, ptr, ptr, ptr, ptr }
%struct.MstVertex_ = type { ptr, double, i32, double, ptr }
%struct.PathVertex_ = type { ptr, double, i32, double, ptr }
%struct.ListElmt_ = type { ptr, ptr }
%struct.TspVertex_ = type { ptr, double, double, i32 }

@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [35 x i8], align 1
@MstTestV = external hidden global [9 x [2 x i8]], align 16
@MstTestE = external hidden global [28 x %struct.EdgeData_], align 16
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@PthTestV = external hidden global [6 x [2 x i8]], align 1
@PthTestE = external hidden global [11 x %struct.EdgeData_], align 16
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [38 x i8], align 1
@TspTestV = external hidden global [7 x %struct.CoordData_], align 16
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.Graph_, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.MstVertex_, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.PathVertex_, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %struct.List_, align 8
  %18 = alloca %struct.List_, align 8
  %19 = alloca %struct.List_, align 8
  %20 = alloca %struct.List_, align 8
  %21 = alloca ptr, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, 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 40, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store double 0.000000e+00, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store double 0.000000e+00, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store double 0.000000e+00, ptr %25, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  call void @graph_init(ptr noundef %6, ptr noundef @match_mst, ptr noundef @free)
  %28 = load ptr, ptr @stdout, align 8, !tbaa !9
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str) #5
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %54, %2
  %31 = load i32, ptr %26, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 9
  br i1 %32, label %33, label %57

33:                                               ; preds = %30
  %34 = call noalias ptr @malloc(i64 noundef 40) #6
  store ptr %34, ptr %8, align 8, !tbaa !9
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

37:                                               ; preds = %33
  %38 = load i32, ptr %26, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %42

40:                                               ; preds = %37
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %41, ptr %7, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %40, %37
  %43 = load i32, ptr %26, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [9 x [2 x i8]], ptr @MstTestV, i64 0, i64 %44
  %46 = getelementptr inbounds [2 x i8], ptr %45, i64 0, i64 0
  %47 = load ptr, ptr %8, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.MstVertex_, ptr %47, i32 0, i32 0
  store ptr %46, ptr %48, align 8, !tbaa !13
  %49 = load ptr, ptr %8, align 8, !tbaa !9
  %50 = call i32 @graph_ins_vertex(ptr noundef %6, ptr noundef %49)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %42
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

53:                                               ; preds = %42
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %26, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %26, align 4, !tbaa !5
  br label %30, !llvm.loop !15

57:                                               ; preds = %30
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %91, %57
  %59 = load i32, ptr %26, align 4, !tbaa !5
  %60 = icmp slt i32 %59, 28
  br i1 %60, label %61, label %94

61:                                               ; preds = %58
  %62 = call noalias ptr @malloc(i64 noundef 40) #6
  store ptr %62, ptr %10, align 8, !tbaa !9
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

65:                                               ; preds = %61
  %66 = load i32, ptr %26, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [28 x %struct.EdgeData_], ptr @MstTestE, i64 0, i64 %67
  %69 = getelementptr inbounds %struct.EdgeData_, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds [2 x i8], ptr %69, i64 0, i64 0
  %71 = getelementptr inbounds %struct.MstVertex_, ptr %9, i32 0, i32 0
  store ptr %70, ptr %71, align 8, !tbaa !13
  %72 = load i32, ptr %26, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [28 x %struct.EdgeData_], ptr @MstTestE, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.EdgeData_, ptr %74, i32 0, i32 1
  %76 = getelementptr inbounds [2 x i8], ptr %75, i64 0, i64 0
  %77 = load ptr, ptr %10, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.MstVertex_, ptr %77, i32 0, i32 0
  store ptr %76, ptr %78, align 8, !tbaa !13
  %79 = load i32, ptr %26, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [28 x %struct.EdgeData_], ptr @MstTestE, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.EdgeData_, ptr %81, i32 0, i32 2
  %83 = load double, ptr %82, align 8, !tbaa !17
  %84 = load ptr, ptr %10, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.MstVertex_, ptr %84, i32 0, i32 1
  store double %83, ptr %85, align 8, !tbaa !19
  %86 = load ptr, ptr %10, align 8, !tbaa !9
  %87 = call i32 @graph_ins_edge(ptr noundef %6, ptr noundef %9, ptr noundef %86)
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %65
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

90:                                               ; preds = %65
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %26, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %26, align 4, !tbaa !5
  br label %58, !llvm.loop !20

94:                                               ; preds = %58
  call void @print_graph_mst(ptr noundef %6)
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = call i32 @mst(ptr noundef %6, ptr noundef %95, ptr noundef %17, ptr noundef @match_mst)
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %99

98:                                               ; preds = %94
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

99:                                               ; preds = %94
  %100 = getelementptr inbounds %struct.List_, ptr %17, i32 0, i32 3
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  store ptr %101, ptr %21, align 8, !tbaa !9
  br label %102

102:                                              ; preds = %127, %99
  %103 = load ptr, ptr %21, align 8, !tbaa !9
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %131

105:                                              ; preds = %102
  %106 = load ptr, ptr %21, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.ListElmt_, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !23
  store ptr %108, ptr %8, align 8, !tbaa !9
  %109 = load ptr, ptr @stdout, align 8, !tbaa !9
  %110 = load ptr, ptr %8, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.MstVertex_, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  %113 = load ptr, ptr %8, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.MstVertex_, ptr %113, i32 0, i32 4
  %115 = load ptr, ptr %114, align 8, !tbaa !25
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %123

117:                                              ; preds = %105
  %118 = load ptr, ptr %8, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.MstVertex_, ptr %118, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !25
  %121 = getelementptr inbounds %struct.MstVertex_, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !13
  br label %124

123:                                              ; preds = %105
  br label %124

124:                                              ; preds = %123, %117
  %125 = phi ptr [ %122, %117 ], [ @.str.2, %123 ]
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.1, ptr noundef %112, ptr noundef %125) #5
  br label %127

127:                                              ; preds = %124
  %128 = load ptr, ptr %21, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct.ListElmt_, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !26
  store ptr %130, ptr %21, align 8, !tbaa !9
  br label %102, !llvm.loop !27

131:                                              ; preds = %102
  call void @list_destroy(ptr noundef %17)
  call void @graph_destroy(ptr noundef %6)
  call void @graph_init(ptr noundef %6, ptr noundef @match_pth, ptr noundef @free)
  %132 = load ptr, ptr @stdout, align 8, !tbaa !9
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.3) #5
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %158, %131
  %135 = load i32, ptr %26, align 4, !tbaa !5
  %136 = icmp slt i32 %135, 6
  br i1 %136, label %137, label %161

137:                                              ; preds = %134
  %138 = call noalias ptr @malloc(i64 noundef 40) #6
  store ptr %138, ptr %12, align 8, !tbaa !9
  %139 = icmp eq ptr %138, null
  br i1 %139, label %140, label %141

140:                                              ; preds = %137
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

141:                                              ; preds = %137
  %142 = load i32, ptr %26, align 4, !tbaa !5
  %143 = icmp eq i32 %142, 1
  br i1 %143, label %144, label %146

144:                                              ; preds = %141
  %145 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %145, ptr %11, align 8, !tbaa !9
  br label %146

146:                                              ; preds = %144, %141
  %147 = load i32, ptr %26, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [6 x [2 x i8]], ptr @PthTestV, i64 0, i64 %148
  %150 = getelementptr inbounds [2 x i8], ptr %149, i64 0, i64 0
  %151 = load ptr, ptr %12, align 8, !tbaa !9
  %152 = getelementptr inbounds %struct.PathVertex_, ptr %151, i32 0, i32 0
  store ptr %150, ptr %152, align 8, !tbaa !28
  %153 = load ptr, ptr %12, align 8, !tbaa !9
  %154 = call i32 @graph_ins_vertex(ptr noundef %6, ptr noundef %153)
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %146
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

157:                                              ; preds = %146
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %26, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %26, align 4, !tbaa !5
  br label %134, !llvm.loop !30

161:                                              ; preds = %134
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %195, %161
  %163 = load i32, ptr %26, align 4, !tbaa !5
  %164 = icmp slt i32 %163, 11
  br i1 %164, label %165, label %198

165:                                              ; preds = %162
  %166 = call noalias ptr @malloc(i64 noundef 40) #6
  store ptr %166, ptr %14, align 8, !tbaa !9
  %167 = icmp eq ptr %166, null
  br i1 %167, label %168, label %169

168:                                              ; preds = %165
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

169:                                              ; preds = %165
  %170 = load i32, ptr %26, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [11 x %struct.EdgeData_], ptr @PthTestE, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.EdgeData_, ptr %172, i32 0, i32 0
  %174 = getelementptr inbounds [2 x i8], ptr %173, i64 0, i64 0
  %175 = getelementptr inbounds %struct.PathVertex_, ptr %13, i32 0, i32 0
  store ptr %174, ptr %175, align 8, !tbaa !28
  %176 = load i32, ptr %26, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [11 x %struct.EdgeData_], ptr @PthTestE, i64 0, i64 %177
  %179 = getelementptr inbounds %struct.EdgeData_, ptr %178, i32 0, i32 1
  %180 = getelementptr inbounds [2 x i8], ptr %179, i64 0, i64 0
  %181 = load ptr, ptr %14, align 8, !tbaa !9
  %182 = getelementptr inbounds %struct.PathVertex_, ptr %181, i32 0, i32 0
  store ptr %180, ptr %182, align 8, !tbaa !28
  %183 = load i32, ptr %26, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [11 x %struct.EdgeData_], ptr @PthTestE, i64 0, i64 %184
  %186 = getelementptr inbounds %struct.EdgeData_, ptr %185, i32 0, i32 2
  %187 = load double, ptr %186, align 8, !tbaa !17
  %188 = load ptr, ptr %14, align 8, !tbaa !9
  %189 = getelementptr inbounds %struct.PathVertex_, ptr %188, i32 0, i32 1
  store double %187, ptr %189, align 8, !tbaa !31
  %190 = load ptr, ptr %14, align 8, !tbaa !9
  %191 = call i32 @graph_ins_edge(ptr noundef %6, ptr noundef %13, ptr noundef %190)
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %194

193:                                              ; preds = %169
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

194:                                              ; preds = %169
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %26, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %26, align 4, !tbaa !5
  br label %162, !llvm.loop !32

198:                                              ; preds = %162
  call void @print_graph_pth(ptr noundef %6)
  %199 = load ptr, ptr %11, align 8, !tbaa !9
  %200 = call i32 @shortest(ptr noundef %6, ptr noundef %199, ptr noundef %18, ptr noundef @match_pth)
  %201 = icmp ne i32 %200, 0
  br i1 %201, label %202, label %203

202:                                              ; preds = %198
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

203:                                              ; preds = %198
  %204 = getelementptr inbounds %struct.List_, ptr %18, i32 0, i32 3
  %205 = load ptr, ptr %204, align 8, !tbaa !21
  store ptr %205, ptr %21, align 8, !tbaa !9
  br label %206

206:                                              ; preds = %234, %203
  %207 = load ptr, ptr %21, align 8, !tbaa !9
  %208 = icmp ne ptr %207, null
  br i1 %208, label %209, label %238

209:                                              ; preds = %206
  %210 = load ptr, ptr %21, align 8, !tbaa !9
  %211 = getelementptr inbounds %struct.ListElmt_, ptr %210, i32 0, i32 0
  %212 = load ptr, ptr %211, align 8, !tbaa !23
  store ptr %212, ptr %12, align 8, !tbaa !9
  %213 = load ptr, ptr @stdout, align 8, !tbaa !9
  %214 = load ptr, ptr %12, align 8, !tbaa !9
  %215 = getelementptr inbounds %struct.PathVertex_, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !28
  %217 = load ptr, ptr %12, align 8, !tbaa !9
  %218 = getelementptr inbounds %struct.PathVertex_, ptr %217, i32 0, i32 4
  %219 = load ptr, ptr %218, align 8, !tbaa !33
  %220 = icmp ne ptr %219, null
  br i1 %220, label %221, label %227

221:                                              ; preds = %209
  %222 = load ptr, ptr %12, align 8, !tbaa !9
  %223 = getelementptr inbounds %struct.PathVertex_, ptr %222, i32 0, i32 4
  %224 = load ptr, ptr %223, align 8, !tbaa !33
  %225 = getelementptr inbounds %struct.PathVertex_, ptr %224, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8, !tbaa !28
  br label %228

227:                                              ; preds = %209
  br label %228

228:                                              ; preds = %227, %221
  %229 = phi ptr [ %226, %221 ], [ @.str.2, %227 ]
  %230 = load ptr, ptr %12, align 8, !tbaa !9
  %231 = getelementptr inbounds %struct.PathVertex_, ptr %230, i32 0, i32 3
  %232 = load double, ptr %231, align 8, !tbaa !34
  %233 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %213, ptr noundef @.str.4, ptr noundef %216, ptr noundef %229, double noundef %232) #5
  br label %234

234:                                              ; preds = %228
  %235 = load ptr, ptr %21, align 8, !tbaa !9
  %236 = getelementptr inbounds %struct.ListElmt_, ptr %235, i32 0, i32 1
  %237 = load ptr, ptr %236, align 8, !tbaa !26
  store ptr %237, ptr %21, align 8, !tbaa !9
  br label %206, !llvm.loop !35

238:                                              ; preds = %206
  call void @list_destroy(ptr noundef %18)
  call void @graph_destroy(ptr noundef %6)
  call void @list_init(ptr noundef %19, ptr noundef @free)
  %239 = load ptr, ptr @stdout, align 8, !tbaa !9
  %240 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %239, ptr noundef @.str.5) #5
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %282, %238
  %242 = load i32, ptr %26, align 4, !tbaa !5
  %243 = icmp slt i32 %242, 7
  br i1 %243, label %244, label %285

244:                                              ; preds = %241
  %245 = call noalias ptr @malloc(i64 noundef 32) #6
  store ptr %245, ptr %16, align 8, !tbaa !9
  %246 = icmp eq ptr %245, null
  br i1 %246, label %247, label %248

247:                                              ; preds = %244
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

248:                                              ; preds = %244
  %249 = load i32, ptr %26, align 4, !tbaa !5
  %250 = icmp eq i32 %249, 0
  br i1 %250, label %251, label %253

251:                                              ; preds = %248
  %252 = load ptr, ptr %16, align 8, !tbaa !9
  store ptr %252, ptr %15, align 8, !tbaa !9
  br label %253

253:                                              ; preds = %251, %248
  %254 = load i32, ptr %26, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [7 x %struct.CoordData_], ptr @TspTestV, i64 0, i64 %255
  %257 = getelementptr inbounds %struct.CoordData_, ptr %256, i32 0, i32 0
  %258 = getelementptr inbounds [2 x i8], ptr %257, i64 0, i64 0
  %259 = load ptr, ptr %16, align 8, !tbaa !9
  %260 = getelementptr inbounds %struct.TspVertex_, ptr %259, i32 0, i32 0
  store ptr %258, ptr %260, align 8, !tbaa !36
  %261 = load i32, ptr %26, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [7 x %struct.CoordData_], ptr @TspTestV, i64 0, i64 %262
  %264 = getelementptr inbounds %struct.CoordData_, ptr %263, i32 0, i32 1
  %265 = load double, ptr %264, align 8, !tbaa !38
  %266 = load ptr, ptr %16, align 8, !tbaa !9
  %267 = getelementptr inbounds %struct.TspVertex_, ptr %266, i32 0, i32 1
  store double %265, ptr %267, align 8, !tbaa !40
  %268 = load i32, ptr %26, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [7 x %struct.CoordData_], ptr @TspTestV, i64 0, i64 %269
  %271 = getelementptr inbounds %struct.CoordData_, ptr %270, i32 0, i32 2
  %272 = load double, ptr %271, align 8, !tbaa !41
  %273 = load ptr, ptr %16, align 8, !tbaa !9
  %274 = getelementptr inbounds %struct.TspVertex_, ptr %273, i32 0, i32 2
  store double %272, ptr %274, align 8, !tbaa !42
  %275 = getelementptr inbounds %struct.List_, ptr %19, i32 0, i32 4
  %276 = load ptr, ptr %275, align 8, !tbaa !43
  %277 = load ptr, ptr %16, align 8, !tbaa !9
  %278 = call i32 @list_ins_next(ptr noundef %19, ptr noundef %276, ptr noundef %277)
  %279 = icmp ne i32 %278, 0
  br i1 %279, label %280, label %281

280:                                              ; preds = %253
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

281:                                              ; preds = %253
  br label %282

282:                                              ; preds = %281
  %283 = load i32, ptr %26, align 4, !tbaa !5
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %26, align 4, !tbaa !5
  br label %241, !llvm.loop !44

285:                                              ; preds = %241
  call void @print_list_tsp(ptr noundef %19)
  %286 = load ptr, ptr %15, align 8, !tbaa !9
  %287 = call i32 @tsp(ptr noundef %19, ptr noundef %286, ptr noundef %20, ptr noundef @match_tsp)
  %288 = icmp ne i32 %287, 0
  br i1 %288, label %289, label %290

289:                                              ; preds = %285
  store i32 1, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

290:                                              ; preds = %285
  store double 0.000000e+00, ptr %23, align 8, !tbaa !11
  %291 = getelementptr inbounds %struct.List_, ptr %20, i32 0, i32 3
  %292 = load ptr, ptr %291, align 8, !tbaa !21
  store ptr %292, ptr %21, align 8, !tbaa !9
  br label %293

293:                                              ; preds = %351, %290
  %294 = load ptr, ptr %21, align 8, !tbaa !9
  %295 = icmp ne ptr %294, null
  br i1 %295, label %296, label %355

296:                                              ; preds = %293
  %297 = load ptr, ptr %21, align 8, !tbaa !9
  %298 = getelementptr inbounds %struct.ListElmt_, ptr %297, i32 0, i32 0
  %299 = load ptr, ptr %298, align 8, !tbaa !23
  store ptr %299, ptr %16, align 8, !tbaa !9
  %300 = load ptr, ptr %21, align 8, !tbaa !9
  %301 = getelementptr inbounds %struct.List_, ptr %20, i32 0, i32 3
  %302 = load ptr, ptr %301, align 8, !tbaa !21
  %303 = icmp eq ptr %300, %302
  br i1 %303, label %304, label %305

304:                                              ; preds = %296
  br i1 true, label %324, label %306

305:                                              ; preds = %296
  br i1 false, label %324, label %306

306:                                              ; preds = %305, %304
  %307 = load ptr, ptr %16, align 8, !tbaa !9
  %308 = getelementptr inbounds %struct.TspVertex_, ptr %307, i32 0, i32 1
  %309 = load double, ptr %308, align 8, !tbaa !40
  %310 = load double, ptr %24, align 8, !tbaa !11
  %311 = fsub double %309, %310
  %312 = call double @pow(double noundef %311, double noundef 2.000000e+00) #5
  %313 = load ptr, ptr %16, align 8, !tbaa !9
  %314 = getelementptr inbounds %struct.TspVertex_, ptr %313, i32 0, i32 2
  %315 = load double, ptr %314, align 8, !tbaa !42
  %316 = load double, ptr %25, align 8, !tbaa !11
  %317 = fsub double %315, %316
  %318 = call double @pow(double noundef %317, double noundef 2.000000e+00) #5
  %319 = fadd double %312, %318
  %320 = call double @sqrt(double noundef %319) #5
  store double %320, ptr %22, align 8, !tbaa !11
  %321 = load double, ptr %23, align 8, !tbaa !11
  %322 = load double, ptr %22, align 8, !tbaa !11
  %323 = fadd double %321, %322
  store double %323, ptr %23, align 8, !tbaa !11
  br label %324

324:                                              ; preds = %306, %305, %304
  %325 = load ptr, ptr %16, align 8, !tbaa !9
  %326 = getelementptr inbounds %struct.TspVertex_, ptr %325, i32 0, i32 1
  %327 = load double, ptr %326, align 8, !tbaa !40
  store double %327, ptr %24, align 8, !tbaa !11
  %328 = load ptr, ptr %16, align 8, !tbaa !9
  %329 = getelementptr inbounds %struct.TspVertex_, ptr %328, i32 0, i32 2
  %330 = load double, ptr %329, align 8, !tbaa !42
  store double %330, ptr %25, align 8, !tbaa !11
  %331 = load ptr, ptr %21, align 8, !tbaa !9
  %332 = getelementptr inbounds %struct.List_, ptr %20, i32 0, i32 3
  %333 = load ptr, ptr %332, align 8, !tbaa !21
  %334 = icmp eq ptr %331, %333
  br i1 %334, label %335, label %336

335:                                              ; preds = %324
  br i1 true, label %344, label %337

336:                                              ; preds = %324
  br i1 false, label %344, label %337

337:                                              ; preds = %336, %335
  %338 = load ptr, ptr @stdout, align 8, !tbaa !9
  %339 = load ptr, ptr %16, align 8, !tbaa !9
  %340 = getelementptr inbounds %struct.TspVertex_, ptr %339, i32 0, i32 0
  %341 = load ptr, ptr %340, align 8, !tbaa !36
  %342 = load double, ptr %22, align 8, !tbaa !11
  %343 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %338, ptr noundef @.str.6, ptr noundef %341, double noundef %342) #5
  br label %350

344:                                              ; preds = %336, %335
  %345 = load ptr, ptr @stdout, align 8, !tbaa !9
  %346 = load ptr, ptr %16, align 8, !tbaa !9
  %347 = getelementptr inbounds %struct.TspVertex_, ptr %346, i32 0, i32 0
  %348 = load ptr, ptr %347, align 8, !tbaa !36
  %349 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %345, ptr noundef @.str.7, ptr noundef %348) #5
  br label %350

350:                                              ; preds = %344, %337
  br label %351

351:                                              ; preds = %350
  %352 = load ptr, ptr %21, align 8, !tbaa !9
  %353 = getelementptr inbounds %struct.ListElmt_, ptr %352, i32 0, i32 1
  %354 = load ptr, ptr %353, align 8, !tbaa !26
  store ptr %354, ptr %21, align 8, !tbaa !9
  br label %293, !llvm.loop !45

355:                                              ; preds = %293
  %356 = load ptr, ptr @stdout, align 8, !tbaa !9
  %357 = load double, ptr %23, align 8, !tbaa !11
  %358 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %356, ptr noundef @.str.8, double noundef %357) #5
  call void @list_destroy(ptr noundef %19)
  call void @list_destroy(ptr noundef %20)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %27, align 4
  br label %359

359:                                              ; preds = %355, %289, %280, %247, %202, %193, %168, %156, %140, %98, %89, %64, %52, %36
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 40, 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 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %6) #5
  %360 = load i32, ptr %3, align 4
  ret i32 %360
}

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @match_mst(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare i32 @graph_ins_vertex(ptr noundef, ptr noundef) #2

declare i32 @graph_ins_edge(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @print_graph_mst(ptr noundef) #0

declare i32 @mst(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @list_destroy(ptr noundef) #2

declare void @graph_destroy(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @match_pth(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @print_graph_pth(ptr noundef) #0

declare i32 @shortest(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

declare i32 @list_ins_next(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @print_list_tsp(ptr noundef) #0

declare i32 @tsp(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @match_tsp(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #3

; 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 = { nounwind allocsize(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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"MstVertex_", !10, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !10, i64 32}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !12, i64 8}
!18 = !{!"EdgeData_", !7, i64 0, !7, i64 2, !12, i64 8}
!19 = !{!14, !12, i64 8}
!20 = distinct !{!20, !16}
!21 = !{!22, !10, i64 24}
!22 = !{!"List_", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!23 = !{!24, !10, i64 0}
!24 = !{!"ListElmt_", !10, i64 0, !10, i64 8}
!25 = !{!14, !10, i64 32}
!26 = !{!24, !10, i64 8}
!27 = distinct !{!27, !16}
!28 = !{!29, !10, i64 0}
!29 = !{!"PathVertex_", !10, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !10, i64 32}
!30 = distinct !{!30, !16}
!31 = !{!29, !12, i64 8}
!32 = distinct !{!32, !16}
!33 = !{!29, !10, i64 32}
!34 = !{!29, !12, i64 24}
!35 = distinct !{!35, !16}
!36 = !{!37, !10, i64 0}
!37 = !{!"TspVertex_", !10, i64 0, !12, i64 8, !12, i64 16, !6, i64 24}
!38 = !{!39, !12, i64 8}
!39 = !{!"CoordData_", !7, i64 0, !12, i64 8, !12, i64 16}
!40 = !{!37, !12, i64 8}
!41 = !{!39, !12, i64 16}
!42 = !{!37, !12, i64 16}
!43 = !{!22, !10, i64 32}
!44 = distinct !{!44, !16}
!45 = distinct !{!45, !16}


; 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"

%struct.EdgeData_ = type { [2 x i8], [2 x i8], double }
%struct.CoordData_ = type { [2 x i8], double, double }
%struct.Graph_ = type { i32, i32, ptr, ptr, %struct.List_ }
%struct.List_ = type { i32, ptr, ptr, ptr, ptr }
%struct.MstVertex_ = type { ptr, double, i32, double, ptr }
%struct.PathVertex_ = type { ptr, double, i32, double, ptr }

@stdout = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [35 x i8], align 1
@MstTestV = external hidden global [9 x [2 x i8]], align 16
@MstTestE = external hidden global [28 x %struct.EdgeData_], align 16
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@PthTestV = external hidden global [6 x [2 x i8]], align 1
@PthTestE = external hidden global [11 x %struct.EdgeData_], align 16
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [38 x i8], align 1
@TspTestV = external hidden global [7 x %struct.CoordData_], align 16
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.Graph_, align 8
  %4 = alloca %struct.MstVertex_, align 8
  %5 = alloca %struct.PathVertex_, align 8
  %6 = alloca %struct.List_, align 8
  %7 = alloca %struct.List_, align 8
  %8 = alloca %struct.List_, align 8
  %9 = alloca %struct.List_, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #7
  call void @graph_init(ptr noundef nonnull %3, ptr noundef nonnull @match_mst, ptr noundef nonnull @free) #7
  %10 = load ptr, ptr @stdout, align 8, !tbaa !5
  %11 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str) #7
  %12 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %13 = icmp eq ptr %12, null
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %2
  store ptr @MstTestV, ptr %12, align 8, !tbaa !9
  %15 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %12) #7
  %.not109 = icmp eq i32 %15, 0
  br i1 %.not109, label %16, label %.loopexit

16:                                               ; preds = %14
  %17 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %18 = icmp eq ptr %17, null
  br i1 %18, label %.loopexit, label %19

19:                                               ; preds = %16
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 2), ptr %17, align 8, !tbaa !9
  %20 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %17) #7
  %.not109.1 = icmp eq i32 %20, 0
  br i1 %.not109.1, label %21, label %.loopexit

21:                                               ; preds = %19
  %22 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %23 = icmp eq ptr %22, null
  br i1 %23, label %.loopexit, label %24

24:                                               ; preds = %21
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 4), ptr %22, align 8, !tbaa !9
  %25 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %22) #7
  %.not109.2 = icmp eq i32 %25, 0
  br i1 %.not109.2, label %26, label %.loopexit

26:                                               ; preds = %24
  %27 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %28 = icmp eq ptr %27, null
  br i1 %28, label %.loopexit, label %29

29:                                               ; preds = %26
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 6), ptr %27, align 8, !tbaa !9
  %30 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %27) #7
  %.not109.3 = icmp eq i32 %30, 0
  br i1 %.not109.3, label %31, label %.loopexit

31:                                               ; preds = %29
  %32 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %33 = icmp eq ptr %32, null
  br i1 %33, label %.loopexit, label %34

34:                                               ; preds = %31
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 8), ptr %32, align 8, !tbaa !9
  %35 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %32) #7
  %.not109.4 = icmp eq i32 %35, 0
  br i1 %.not109.4, label %36, label %.loopexit

36:                                               ; preds = %34
  %37 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %38 = icmp eq ptr %37, null
  br i1 %38, label %.loopexit, label %39

39:                                               ; preds = %36
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 10), ptr %37, align 8, !tbaa !9
  %40 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %37) #7
  %.not109.5 = icmp eq i32 %40, 0
  br i1 %.not109.5, label %41, label %.loopexit

41:                                               ; preds = %39
  %42 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %43 = icmp eq ptr %42, null
  br i1 %43, label %.loopexit, label %44

44:                                               ; preds = %41
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 12), ptr %42, align 8, !tbaa !9
  %45 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %42) #7
  %.not109.6 = icmp eq i32 %45, 0
  br i1 %.not109.6, label %46, label %.loopexit

46:                                               ; preds = %44
  %47 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %48 = icmp eq ptr %47, null
  br i1 %48, label %.loopexit, label %49

49:                                               ; preds = %46
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 14), ptr %47, align 8, !tbaa !9
  %50 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %47) #7
  %.not109.7 = icmp eq i32 %50, 0
  br i1 %.not109.7, label %51, label %.loopexit

51:                                               ; preds = %49
  %52 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %53 = icmp eq ptr %52, null
  br i1 %53, label %.loopexit, label %54

54:                                               ; preds = %51
  store ptr getelementptr inbounds (i8, ptr @MstTestV, i64 16), ptr %52, align 8, !tbaa !9
  %55 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %52) #7
  %.not109.8 = icmp eq i32 %55, 0
  br i1 %.not109.8, label %.preheader114, label %.loopexit

56:                                               ; preds = %59
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 28
  br i1 %exitcond.not, label %66, label %.preheader114, !llvm.loop !13

.preheader114:                                    ; preds = %54, %56
  %indvars.iv = phi i64 [ %indvars.iv.next, %56 ], [ 0, %54 ]
  %57 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %58 = icmp eq ptr %57, null
  br i1 %58, label %.loopexit, label %59

59:                                               ; preds = %.preheader114
  %60 = getelementptr inbounds [28 x %struct.EdgeData_], ptr @MstTestE, i64 0, i64 %indvars.iv
  store ptr %60, ptr %4, align 8, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %60, i64 2
  store ptr %61, ptr %57, align 8, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %60, i64 8
  %63 = load double, ptr %62, align 8, !tbaa !15
  %64 = getelementptr inbounds i8, ptr %57, i64 8
  store double %63, ptr %64, align 8, !tbaa !17
  %65 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %57) #7
  %.not108 = icmp eq i32 %65, 0
  br i1 %.not108, label %56, label %.loopexit

66:                                               ; preds = %56
  call void @print_graph_mst(ptr noundef nonnull %3)
  %67 = call i32 @mst(ptr noundef nonnull %3, ptr noundef nonnull %12, ptr noundef nonnull %6, ptr noundef nonnull @match_mst) #7
  %.not = icmp eq i32 %67, 0
  br i1 %.not, label %68, label %.loopexit

68:                                               ; preds = %66
  %69 = getelementptr inbounds i8, ptr %6, i64 24
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %.not97123 = icmp eq ptr %70, null
  br i1 %.not97123, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %68, %78
  %.080124 = phi ptr [ %82, %78 ], [ %70, %68 ]
  %71 = load ptr, ptr %.080124, align 8, !tbaa !20
  %72 = load ptr, ptr @stdout, align 8, !tbaa !5
  %73 = load ptr, ptr %71, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %71, i64 32
  %75 = load ptr, ptr %74, align 8, !tbaa !22
  %.not107 = icmp eq ptr %75, null
  br i1 %.not107, label %78, label %76

76:                                               ; preds = %.lr.ph
  %77 = load ptr, ptr %75, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %.lr.ph, %76
  %79 = phi ptr [ %77, %76 ], [ @.str.2, %.lr.ph ]
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.1, ptr noundef %73, ptr noundef %79) #7
  %81 = getelementptr inbounds i8, ptr %.080124, i64 8
  %82 = load ptr, ptr %81, align 8, !tbaa !23
  %.not97 = icmp eq ptr %82, null
  br i1 %.not97, label %._crit_edge, label %.lr.ph, !llvm.loop !24

._crit_edge:                                      ; preds = %78, %68
  call void @list_destroy(ptr noundef nonnull %6) #7
  call void @graph_destroy(ptr noundef nonnull %3) #7
  call void @graph_init(ptr noundef nonnull %3, ptr noundef nonnull @match_pth, ptr noundef nonnull @free) #7
  %83 = load ptr, ptr @stdout, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.3) #7
  %85 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %86 = icmp eq ptr %85, null
  br i1 %86, label %.loopexit, label %87

87:                                               ; preds = %._crit_edge
  store ptr @PthTestV, ptr %85, align 8, !tbaa !25
  %88 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %85) #7
  %.not106 = icmp eq i32 %88, 0
  br i1 %.not106, label %89, label %.loopexit

89:                                               ; preds = %87
  %90 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %91 = icmp eq ptr %90, null
  br i1 %91, label %.loopexit, label %92

92:                                               ; preds = %89
  store ptr getelementptr inbounds (i8, ptr @PthTestV, i64 2), ptr %90, align 8, !tbaa !25
  %93 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %90) #7
  %.not106.1 = icmp eq i32 %93, 0
  br i1 %.not106.1, label %94, label %.loopexit

94:                                               ; preds = %92
  %95 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %96 = icmp eq ptr %95, null
  br i1 %96, label %.loopexit, label %97

97:                                               ; preds = %94
  store ptr getelementptr inbounds (i8, ptr @PthTestV, i64 4), ptr %95, align 8, !tbaa !25
  %98 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %95) #7
  %.not106.2 = icmp eq i32 %98, 0
  br i1 %.not106.2, label %99, label %.loopexit

99:                                               ; preds = %97
  %100 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %101 = icmp eq ptr %100, null
  br i1 %101, label %.loopexit, label %102

102:                                              ; preds = %99
  store ptr getelementptr inbounds (i8, ptr @PthTestV, i64 6), ptr %100, align 8, !tbaa !25
  %103 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %100) #7
  %.not106.3 = icmp eq i32 %103, 0
  br i1 %.not106.3, label %104, label %.loopexit

104:                                              ; preds = %102
  %105 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %106 = icmp eq ptr %105, null
  br i1 %106, label %.loopexit, label %107

107:                                              ; preds = %104
  store ptr getelementptr inbounds (i8, ptr @PthTestV, i64 8), ptr %105, align 8, !tbaa !25
  %108 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %105) #7
  %.not106.4 = icmp eq i32 %108, 0
  br i1 %.not106.4, label %109, label %.loopexit

109:                                              ; preds = %107
  %110 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %111 = icmp eq ptr %110, null
  br i1 %111, label %.loopexit, label %112

112:                                              ; preds = %109
  store ptr getelementptr inbounds (i8, ptr @PthTestV, i64 10), ptr %110, align 8, !tbaa !25
  %113 = call i32 @graph_ins_vertex(ptr noundef nonnull %3, ptr noundef nonnull %110) #7
  %.not106.5 = icmp eq i32 %113, 0
  br i1 %.not106.5, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %112
  %114 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %115 = icmp eq ptr %114, null
  br i1 %115, label %.loopexit, label %188

116:                                              ; preds = %188
  %117 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %118 = icmp eq ptr %117, null
  br i1 %118, label %.loopexit, label %119

119:                                              ; preds = %116
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 16), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 18), ptr %117, align 8, !tbaa !25
  %120 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 24), align 8, !tbaa !15
  %121 = getelementptr inbounds i8, ptr %117, i64 8
  store double %120, ptr %121, align 8, !tbaa !27
  %122 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %117) #7
  %.not105.1 = icmp eq i32 %122, 0
  br i1 %.not105.1, label %123, label %.loopexit

123:                                              ; preds = %119
  %124 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %125 = icmp eq ptr %124, null
  br i1 %125, label %.loopexit, label %126

126:                                              ; preds = %123
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 32), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 34), ptr %124, align 8, !tbaa !25
  %127 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 40), align 8, !tbaa !15
  %128 = getelementptr inbounds i8, ptr %124, i64 8
  store double %127, ptr %128, align 8, !tbaa !27
  %129 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %124) #7
  %.not105.2 = icmp eq i32 %129, 0
  br i1 %.not105.2, label %130, label %.loopexit

130:                                              ; preds = %126
  %131 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %132 = icmp eq ptr %131, null
  br i1 %132, label %.loopexit, label %133

133:                                              ; preds = %130
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 48), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 50), ptr %131, align 8, !tbaa !25
  %134 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 56), align 8, !tbaa !15
  %135 = getelementptr inbounds i8, ptr %131, i64 8
  store double %134, ptr %135, align 8, !tbaa !27
  %136 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %131) #7
  %.not105.3 = icmp eq i32 %136, 0
  br i1 %.not105.3, label %137, label %.loopexit

137:                                              ; preds = %133
  %138 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %139 = icmp eq ptr %138, null
  br i1 %139, label %.loopexit, label %140

140:                                              ; preds = %137
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 64), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 66), ptr %138, align 8, !tbaa !25
  %141 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 72), align 8, !tbaa !15
  %142 = getelementptr inbounds i8, ptr %138, i64 8
  store double %141, ptr %142, align 8, !tbaa !27
  %143 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %138) #7
  %.not105.4 = icmp eq i32 %143, 0
  br i1 %.not105.4, label %144, label %.loopexit

144:                                              ; preds = %140
  %145 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %146 = icmp eq ptr %145, null
  br i1 %146, label %.loopexit, label %147

147:                                              ; preds = %144
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 80), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 82), ptr %145, align 8, !tbaa !25
  %148 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 88), align 8, !tbaa !15
  %149 = getelementptr inbounds i8, ptr %145, i64 8
  store double %148, ptr %149, align 8, !tbaa !27
  %150 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %145) #7
  %.not105.5 = icmp eq i32 %150, 0
  br i1 %.not105.5, label %151, label %.loopexit

151:                                              ; preds = %147
  %152 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %153 = icmp eq ptr %152, null
  br i1 %153, label %.loopexit, label %154

154:                                              ; preds = %151
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 96), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 98), ptr %152, align 8, !tbaa !25
  %155 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 104), align 8, !tbaa !15
  %156 = getelementptr inbounds i8, ptr %152, i64 8
  store double %155, ptr %156, align 8, !tbaa !27
  %157 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %152) #7
  %.not105.6 = icmp eq i32 %157, 0
  br i1 %.not105.6, label %158, label %.loopexit

158:                                              ; preds = %154
  %159 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %160 = icmp eq ptr %159, null
  br i1 %160, label %.loopexit, label %161

161:                                              ; preds = %158
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 112), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 114), ptr %159, align 8, !tbaa !25
  %162 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 120), align 8, !tbaa !15
  %163 = getelementptr inbounds i8, ptr %159, i64 8
  store double %162, ptr %163, align 8, !tbaa !27
  %164 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %159) #7
  %.not105.7 = icmp eq i32 %164, 0
  br i1 %.not105.7, label %165, label %.loopexit

165:                                              ; preds = %161
  %166 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %167 = icmp eq ptr %166, null
  br i1 %167, label %.loopexit, label %168

168:                                              ; preds = %165
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 128), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 130), ptr %166, align 8, !tbaa !25
  %169 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 136), align 8, !tbaa !15
  %170 = getelementptr inbounds i8, ptr %166, i64 8
  store double %169, ptr %170, align 8, !tbaa !27
  %171 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %166) #7
  %.not105.8 = icmp eq i32 %171, 0
  br i1 %.not105.8, label %172, label %.loopexit

172:                                              ; preds = %168
  %173 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %174 = icmp eq ptr %173, null
  br i1 %174, label %.loopexit, label %175

175:                                              ; preds = %172
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 144), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 146), ptr %173, align 8, !tbaa !25
  %176 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 152), align 8, !tbaa !15
  %177 = getelementptr inbounds i8, ptr %173, i64 8
  store double %176, ptr %177, align 8, !tbaa !27
  %178 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %173) #7
  %.not105.9 = icmp eq i32 %178, 0
  br i1 %.not105.9, label %179, label %.loopexit

179:                                              ; preds = %175
  %180 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #8
  %181 = icmp eq ptr %180, null
  br i1 %181, label %.loopexit, label %182

182:                                              ; preds = %179
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 160), ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 162), ptr %180, align 8, !tbaa !25
  %183 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 168), align 8, !tbaa !15
  %184 = getelementptr inbounds i8, ptr %180, i64 8
  store double %183, ptr %184, align 8, !tbaa !27
  %185 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %180) #7
  %.not105.10 = icmp eq i32 %185, 0
  br i1 %.not105.10, label %186, label %.loopexit

186:                                              ; preds = %182
  call void @print_graph_pth(ptr noundef nonnull %3)
  %187 = call i32 @shortest(ptr noundef nonnull %3, ptr noundef nonnull %90, ptr noundef nonnull %7, ptr noundef nonnull @match_pth) #7
  %.not98 = icmp eq i32 %187, 0
  br i1 %.not98, label %192, label %.loopexit

188:                                              ; preds = %.preheader
  store ptr @PthTestE, ptr %5, align 8, !tbaa !25
  store ptr getelementptr inbounds (i8, ptr @PthTestE, i64 2), ptr %114, align 8, !tbaa !25
  %189 = load double, ptr getelementptr inbounds (i8, ptr @PthTestE, i64 8), align 8, !tbaa !15
  %190 = getelementptr inbounds i8, ptr %114, i64 8
  store double %189, ptr %190, align 8, !tbaa !27
  %191 = call i32 @graph_ins_edge(ptr noundef nonnull %3, ptr noundef nonnull %5, ptr noundef nonnull %114) #7
  %.not105 = icmp eq i32 %191, 0
  br i1 %.not105, label %116, label %.loopexit

192:                                              ; preds = %186
  %193 = getelementptr inbounds i8, ptr %7, i64 24
  %194 = load ptr, ptr %193, align 8, !tbaa !18
  %.not99128 = icmp eq ptr %194, null
  br i1 %.not99128, label %._crit_edge132, label %.lr.ph131

.lr.ph131:                                        ; preds = %192, %202
  %.181129 = phi ptr [ %208, %202 ], [ %194, %192 ]
  %195 = load ptr, ptr %.181129, align 8, !tbaa !20
  %196 = load ptr, ptr @stdout, align 8, !tbaa !5
  %197 = load ptr, ptr %195, align 8, !tbaa !25
  %198 = getelementptr inbounds i8, ptr %195, i64 32
  %199 = load ptr, ptr %198, align 8, !tbaa !28
  %.not104 = icmp eq ptr %199, null
  br i1 %.not104, label %202, label %200

200:                                              ; preds = %.lr.ph131
  %201 = load ptr, ptr %199, align 8, !tbaa !25
  br label %202

202:                                              ; preds = %.lr.ph131, %200
  %203 = phi ptr [ %201, %200 ], [ @.str.2, %.lr.ph131 ]
  %204 = getelementptr inbounds i8, ptr %195, i64 24
  %205 = load double, ptr %204, align 8, !tbaa !29
  %206 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef nonnull @.str.4, ptr noundef %197, ptr noundef %203, double noundef %205) #7
  %207 = getelementptr inbounds i8, ptr %.181129, i64 8
  %208 = load ptr, ptr %207, align 8, !tbaa !23
  %.not99 = icmp eq ptr %208, null
  br i1 %.not99, label %._crit_edge132, label %.lr.ph131, !llvm.loop !30

._crit_edge132:                                   ; preds = %202, %192
  call void @list_destroy(ptr noundef nonnull %7) #7
  call void @graph_destroy(ptr noundef nonnull %3) #7
  call void @list_init(ptr noundef nonnull %8, ptr noundef nonnull @free) #7
  %209 = load ptr, ptr @stdout, align 8, !tbaa !5
  %210 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %209, ptr noundef nonnull @.str.5) #7
  %211 = getelementptr inbounds i8, ptr %8, i64 32
  %212 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
  %213 = icmp eq ptr %212, null
  br i1 %213, label %.loopexit, label %214

214:                                              ; preds = %._crit_edge132
  store ptr @TspTestV, ptr %212, align 8, !tbaa !31
  %215 = getelementptr inbounds i8, ptr %212, i64 8
  %216 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @TspTestV, i64 8), align 8, !tbaa !33
  store <2 x double> %216, ptr %215, align 8, !tbaa !33
  %217 = load ptr, ptr %211, align 8, !tbaa !34
  %218 = call i32 @list_ins_next(ptr noundef nonnull %8, ptr noundef %217, ptr noundef nonnull %212) #7
  %.not103 = icmp eq i32 %218, 0
  br i1 %.not103, label %219, label %.loopexit

219:                                              ; preds = %214
  %220 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
  %221 = icmp eq ptr %220, null
  br i1 %221, label %.loopexit, label %222

222:                                              ; preds = %219
  store ptr getelementptr inbounds (i8, ptr @TspTestV, i64 24), ptr %220, align 8, !tbaa !31
  %223 = getelementptr inbounds i8, ptr %220, i64 8
  %224 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @TspTestV, i64 32), align 16, !tbaa !33
  store <2 x double> %224, ptr %223, align 8, !tbaa !33
  %225 = load ptr, ptr %211, align 8, !tbaa !34
  %226 = call i32 @list_ins_next(ptr noundef nonnull %8, ptr noundef %225, ptr noundef nonnull %220) #7
  %.not103.1 = icmp eq i32 %226, 0
  br i1 %.not103.1, label %227, label %.loopexit

227:                                              ; preds = %222
  %228 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
  %229 = icmp eq ptr %228, null
  br i1 %229, label %.loopexit, label %230

230:                                              ; preds = %227
  store ptr getelementptr inbounds (i8, ptr @TspTestV, i64 48), ptr %228, align 8, !tbaa !31
  %231 = getelementptr inbounds i8, ptr %228, i64 8
  %232 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @TspTestV, i64 56), align 8, !tbaa !33
  store <2 x double> %232, ptr %231, align 8, !tbaa !33
  %233 = load ptr, ptr %211, align 8, !tbaa !34
  %234 = call i32 @list_ins_next(ptr noundef nonnull %8, ptr noundef %233, ptr noundef nonnull %228) #7
  %.not103.2 = icmp eq i32 %234, 0
  br i1 %.not103.2, label %235, label %.loopexit

235:                                              ; preds = %230
  %236 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
  %237 = icmp eq ptr %236, null
  br i1 %237, label %.loopexit, label %238

238:                                              ; preds = %235
  store ptr getelementptr inbounds (i8, ptr @TspTestV, i64 72), ptr %236, align 8, !tbaa !31
  %239 = getelementptr inbounds i8, ptr %236, i64 8
  %240 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @TspTestV, i64 80), align 16, !tbaa !33
  store <2 x double> %240, ptr %239, align 8, !tbaa !33
  %241 = load ptr, ptr %211, align 8, !tbaa !34
  %242 = call i32 @list_ins_next(ptr noundef nonnull %8, ptr noundef %241, ptr noundef nonnull %236) #7
  %.not103.3 = icmp eq i32 %242, 0
  br i1 %.not103.3, label %243, label %.loopexit

243:                                              ; preds = %238
  %244 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
  %245 = icmp eq ptr %244, null
  br i1 %245, label %.loopexit, label %246

246:                                              ; preds = %243
  store ptr getelementptr inbounds (i8, ptr @TspTestV, i64 96), ptr %244, align 8, !tbaa !31
  %247 = getelementptr inbounds i8, ptr %244, i64 8
  %248 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @TspTestV, i64 104), align 8, !tbaa !33
  store <2 x double> %248, ptr %247, align 8, !tbaa !33
  %249 = load ptr, ptr %211, align 8, !tbaa !34
  %250 = call i32 @list_ins_next(ptr noundef nonnull %8, ptr noundef %249, ptr noundef nonnull %244) #7
  %.not103.4 = icmp eq i32 %250, 0
  br i1 %.not103.4, label %251, label %.loopexit

251:                                              ; preds = %246
  %252 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
  %253 = icmp eq ptr %252, null
  br i1 %253, label %.loopexit, label %254

254:                                              ; preds = %251
  store ptr getelementptr inbounds (i8, ptr @TspTestV, i64 120), ptr %252, align 8, !tbaa !31
  %255 = getelementptr inbounds i8, ptr %252, i64 8
  %256 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @TspTestV, i64 128), align 16, !tbaa !33
  store <2 x double> %256, ptr %255, align 8, !tbaa !33
  %257 = load ptr, ptr %211, align 8, !tbaa !34
  %258 = call i32 @list_ins_next(ptr noundef nonnull %8, ptr noundef %257, ptr noundef nonnull %252) #7
  %.not103.5 = icmp eq i32 %258, 0
  br i1 %.not103.5, label %259, label %.loopexit

259:                                              ; preds = %254
  %260 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
  %261 = icmp eq ptr %260, null
  br i1 %261, label %.loopexit, label %262

262:                                              ; preds = %259
  store ptr getelementptr inbounds (i8, ptr @TspTestV, i64 144), ptr %260, align 8, !tbaa !31
  %263 = getelementptr inbounds i8, ptr %260, i64 8
  %264 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @TspTestV, i64 152), align 8, !tbaa !33
  store <2 x double> %264, ptr %263, align 8, !tbaa !33
  %265 = load ptr, ptr %211, align 8, !tbaa !34
  %266 = call i32 @list_ins_next(ptr noundef nonnull %8, ptr noundef %265, ptr noundef nonnull %260) #7
  %.not103.6 = icmp eq i32 %266, 0
  br i1 %.not103.6, label %267, label %.loopexit

267:                                              ; preds = %262
  call void @print_list_tsp(ptr noundef nonnull %8)
  %268 = call i32 @tsp(ptr noundef nonnull %8, ptr noundef nonnull %212, ptr noundef nonnull %9, ptr noundef nonnull @match_tsp) #7
  %.not100 = icmp eq i32 %268, 0
  br i1 %.not100, label %269, label %.loopexit

269:                                              ; preds = %267
  %270 = getelementptr inbounds i8, ptr %9, i64 24
  %271 = load ptr, ptr %270, align 8, !tbaa !18
  %.not101135 = icmp eq ptr %271, null
  br i1 %.not101135, label %._crit_edge143, label %.lr.ph142

.lr.ph142:                                        ; preds = %269, %293
  %.076138 = phi double [ %.177168, %293 ], [ 0.000000e+00, %269 ]
  %.282136 = phi ptr [ %296, %293 ], [ %271, %269 ]
  %272 = phi <2 x double> [ %298, %293 ], [ zeroinitializer, %269 ]
  %273 = load ptr, ptr %.282136, align 8, !tbaa !20
  %274 = load ptr, ptr %270, align 8, !tbaa !18
  %275 = icmp eq ptr %.282136, %274
  %.phi.trans.insert = getelementptr inbounds i8, ptr %273, i64 8
  %.pre = load double, ptr %.phi.trans.insert, align 8, !tbaa !35
  br i1 %275, label %289, label %276

276:                                              ; preds = %.lr.ph142
  %277 = getelementptr inbounds i8, ptr %273, i64 16
  %278 = load double, ptr %277, align 8, !tbaa !36
  %279 = insertelement <2 x double> poison, double %.pre, i64 0
  %280 = insertelement <2 x double> %279, double %278, i64 1
  %281 = fsub <2 x double> %280, %272
  %282 = fmul <2 x double> %281, %281
  %shift = shufflevector <2 x double> %282, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %283 = fadd <2 x double> %282, %shift
  %284 = extractelement <2 x double> %283, i64 0
  %sqrt = call double @llvm.sqrt.f64(double %284)
  %285 = fadd double %.076138, %sqrt
  %286 = load ptr, ptr @stdout, align 8, !tbaa !5
  %287 = load ptr, ptr %273, align 8, !tbaa !31
  %288 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %286, ptr noundef nonnull @.str.6, ptr noundef %287, double noundef %sqrt) #7
  br label %293

289:                                              ; preds = %.lr.ph142
  %.phi.trans.insert162 = getelementptr inbounds i8, ptr %273, i64 16
  %.pre163 = load double, ptr %.phi.trans.insert162, align 8, !tbaa !36
  %290 = load ptr, ptr @stdout, align 8, !tbaa !5
  %291 = load ptr, ptr %273, align 8, !tbaa !31
  %292 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %290, ptr noundef nonnull @.str.7, ptr noundef %291) #7
  br label %293

293:                                              ; preds = %276, %289
  %.177168 = phi double [ %285, %276 ], [ %.076138, %289 ]
  %294 = phi double [ %278, %276 ], [ %.pre163, %289 ]
  %295 = getelementptr inbounds i8, ptr %.282136, i64 8
  %296 = load ptr, ptr %295, align 8, !tbaa !23
  %.not101 = icmp eq ptr %296, null
  %297 = insertelement <2 x double> poison, double %.pre, i64 0
  %298 = insertelement <2 x double> %297, double %294, i64 1
  br i1 %.not101, label %._crit_edge143, label %.lr.ph142, !llvm.loop !37

._crit_edge143:                                   ; preds = %293, %269
  %.076.lcssa = phi double [ 0.000000e+00, %269 ], [ %.177168, %293 ]
  %299 = load ptr, ptr @stdout, align 8, !tbaa !5
  %300 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %299, ptr noundef nonnull @.str.8, double noundef %.076.lcssa) #7
  call void @list_destroy(ptr noundef nonnull %8) #7
  call void @list_destroy(ptr noundef nonnull %9) #7
  br label %.loopexit

.loopexit:                                        ; preds = %59, %.preheader114, %14, %2, %16, %19, %21, %24, %26, %29, %31, %34, %36, %39, %41, %44, %46, %49, %51, %54, %87, %._crit_edge, %89, %92, %94, %97, %99, %102, %104, %107, %109, %112, %188, %.preheader, %116, %119, %123, %126, %130, %133, %137, %140, %144, %147, %151, %154, %158, %161, %165, %168, %172, %175, %179, %182, %214, %._crit_edge132, %219, %222, %227, %230, %235, %238, %243, %246, %251, %254, %259, %262, %267, %186, %66, %._crit_edge143
  %.085 = phi i32 [ 0, %._crit_edge143 ], [ 1, %66 ], [ 1, %186 ], [ 1, %267 ], [ 1, %262 ], [ 1, %259 ], [ 1, %254 ], [ 1, %251 ], [ 1, %246 ], [ 1, %243 ], [ 1, %238 ], [ 1, %235 ], [ 1, %230 ], [ 1, %227 ], [ 1, %222 ], [ 1, %219 ], [ 1, %._crit_edge132 ], [ 1, %214 ], [ 1, %182 ], [ 1, %179 ], [ 1, %175 ], [ 1, %172 ], [ 1, %168 ], [ 1, %165 ], [ 1, %161 ], [ 1, %158 ], [ 1, %154 ], [ 1, %151 ], [ 1, %147 ], [ 1, %144 ], [ 1, %140 ], [ 1, %137 ], [ 1, %133 ], [ 1, %130 ], [ 1, %126 ], [ 1, %123 ], [ 1, %119 ], [ 1, %116 ], [ 1, %.preheader ], [ 1, %188 ], [ 1, %112 ], [ 1, %109 ], [ 1, %107 ], [ 1, %104 ], [ 1, %102 ], [ 1, %99 ], [ 1, %97 ], [ 1, %94 ], [ 1, %92 ], [ 1, %89 ], [ 1, %._crit_edge ], [ 1, %87 ], [ 1, %54 ], [ 1, %51 ], [ 1, %49 ], [ 1, %46 ], [ 1, %44 ], [ 1, %41 ], [ 1, %39 ], [ 1, %36 ], [ 1, %34 ], [ 1, %31 ], [ 1, %29 ], [ 1, %26 ], [ 1, %24 ], [ 1, %21 ], [ 1, %19 ], [ 1, %16 ], [ 1, %2 ], [ 1, %14 ], [ 1, %.preheader114 ], [ 1, %59 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  ret i32 %.085
}

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

declare void @graph_init(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @match_mst(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) #3

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

declare i32 @graph_ins_vertex(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @graph_ins_edge(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @print_graph_mst(ptr noundef) local_unnamed_addr #0

declare i32 @mst(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @list_destroy(ptr noundef) local_unnamed_addr #2

declare void @graph_destroy(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @match_pth(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @print_graph_pth(ptr noundef) local_unnamed_addr #0

declare i32 @shortest(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @list_init(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @list_ins_next(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @print_list_tsp(ptr noundef) local_unnamed_addr #0

declare i32 @tsp(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @match_tsp(ptr noundef, ptr noundef) #0

; 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 double @llvm.sqrt.f64(double) #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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nounwind allocsize(0) }

!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, !6, i64 0}
!10 = !{!"MstVertex_", !6, i64 0, !11, i64 8, !12, i64 16, !11, i64 24, !6, i64 32}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !11, i64 8}
!16 = !{!"EdgeData_", !7, i64 0, !7, i64 2, !11, i64 8}
!17 = !{!10, !11, i64 8}
!18 = !{!19, !6, i64 24}
!19 = !{!"List_", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!20 = !{!21, !6, i64 0}
!21 = !{!"ListElmt_", !6, i64 0, !6, i64 8}
!22 = !{!10, !6, i64 32}
!23 = !{!21, !6, i64 8}
!24 = distinct !{!24, !14}
!25 = !{!26, !6, i64 0}
!26 = !{!"PathVertex_", !6, i64 0, !11, i64 8, !12, i64 16, !11, i64 24, !6, i64 32}
!27 = !{!26, !11, i64 8}
!28 = !{!26, !6, i64 32}
!29 = !{!26, !11, i64 24}
!30 = distinct !{!30, !14}
!31 = !{!32, !6, i64 0}
!32 = !{!"TspVertex_", !6, i64 0, !11, i64 8, !11, i64 16, !12, i64 24}
!33 = !{!11, !11, i64 0}
!34 = !{!19, !6, i64 32}
!35 = !{!32, !11, i64 8}
!36 = !{!32, !11, i64 16}
!37 = distinct !{!37, !14}


; Effective O3 passes: ADCEPass,AggressiveInstCombinePass,BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass