; LLVM IR from kalininalab/rinminer :: rinminer (rinminer)

; 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.edge_label_t = type { i32, i32 }
%struct.database_t = type { ptr, i32, i32, i32 }
%struct.neighbor_t = type { i16, %struct.edge_label_t, i32 }
%struct.database_entry_t = type { ptr, ptr, ptr, i32, i32, i32, i32 }

@stderr = external global ptr, align 8
@.str.27 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [80 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

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

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

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

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

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #3

declare i32 @fgetc(ptr noundef) #5

declare i32 @ungetc(i32 noundef, ptr noundef) #5

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #6

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @invert_direction(i32 noundef) #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @edge_label_compare(ptr noundef, ptr noundef) #8

; Function Attrs: nounwind uwtable
declare dso_local void @write_header_entry(ptr noundef, ptr noundef, i64 noundef) #9

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

; Function Attrs: nounwind uwtable
define dso_local void @read_database_file(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef %6, ptr noundef %7) #9 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %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 i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i8, align 1
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %struct.edge_label_t, align 4
  %33 = alloca i32, align 4
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca ptr, align 8
  %44 = alloca ptr, align 8
  %45 = alloca ptr, align 8
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  %48 = alloca ptr, align 8
  %49 = alloca ptr, align 8
  %50 = alloca i32, align 4
  %51 = alloca ptr, align 8
  %52 = alloca i32, align 4
  %53 = alloca ptr, align 8
  %54 = alloca ptr, align 8
  %55 = alloca [4096 x i8], align 16
  %56 = alloca ptr, align 8
  %57 = alloca i32, align 4
  %58 = alloca i32, align 4
  %59 = alloca i64, align 8
  %60 = alloca i64, align 8
  %61 = alloca i32, align 4
  %62 = alloca ptr, align 8
  %63 = alloca i32, align 4
  %64 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #11
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #11
  store i64 0, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #11
  store i64 0, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #11
  store i64 0, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #11
  store i64 4096, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #11
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #11
  store i8 0, ptr %24, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #11
  store i32 -1, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #11
  store i32 0, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #11
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #11
  store i32 0, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #11
  store i32 0, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #11
  store i32 0, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #11
  call void @llvm.memset.p0.i64(ptr align 4 %32, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #11
  store ptr null, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #11
  store i32 0, ptr %35, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #11
  store i32 0, ptr %36, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #11
  store i32 0, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #11
  store i32 0, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #11
  store i32 0, ptr %40, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #11
  store i32 0, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #11
  store i32 0, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #11
  store ptr null, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #11
  store ptr null, ptr %44, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #11
  store ptr null, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #11
  store ptr null, ptr %46, align 8, !tbaa !5
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.database_t, ptr %65, i32 0, i32 2
  store i32 0, ptr %66, align 4, !tbaa !14
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.database_t, ptr %67, i32 0, i32 1
  store i32 0, ptr %68, align 8, !tbaa !16
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.database_t, ptr %69, i32 0, i32 0
  store ptr null, ptr %70, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #11
  store ptr @.str.27, ptr %47, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #11
  store ptr null, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #11
  store ptr null, ptr %49, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #11
  store i32 0, ptr %50, align 4, !tbaa !9
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %99

73:                                               ; preds = %8
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  %75 = call noalias ptr @strdup(ptr noundef %74) #11
  store ptr %75, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #11
  %76 = load ptr, ptr %48, align 8, !tbaa !5
  %77 = load ptr, ptr %47, align 8, !tbaa !5
  %78 = call ptr @strtok(ptr noundef %76, ptr noundef %77) #11
  store ptr %78, ptr %51, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %82, %73
  %80 = load ptr, ptr %51, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %98

82:                                               ; preds = %79
  %83 = load i32, ptr %50, align 4, !tbaa !9
  %84 = add i32 %83, 1
  store i32 %84, ptr %50, align 4, !tbaa !9
  %85 = load ptr, ptr %49, align 8, !tbaa !5
  %86 = load i32, ptr %50, align 4, !tbaa !9
  %87 = zext i32 %86 to i64
  %88 = mul i64 %87, 8
  %89 = call ptr @realloc(ptr noundef %85, i64 noundef %88) #12
  store ptr %89, ptr %49, align 8, !tbaa !5
  %90 = load ptr, ptr %51, align 8, !tbaa !5
  %91 = load ptr, ptr %49, align 8, !tbaa !5
  %92 = load i32, ptr %50, align 4, !tbaa !9
  %93 = sub i32 %92, 1
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds ptr, ptr %91, i64 %94
  store ptr %90, ptr %95, align 8, !tbaa !5
  %96 = load ptr, ptr %47, align 8, !tbaa !5
  %97 = call ptr @strtok(ptr noundef null, ptr noundef %96) #11
  store ptr %97, ptr %51, align 8, !tbaa !5
  br label %79, !llvm.loop !18

98:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #11
  br label %99

99:                                               ; preds = %98, %8
  br label %100

100:                                              ; preds = %803, %99
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = call i32 @feof(ptr noundef %101) #11
  %103 = icmp ne i32 %102, 0
  %104 = xor i1 %103, true
  br i1 %104, label %105, label %804

105:                                              ; preds = %100
  store i64 0, ptr %19, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %141, %105
  %107 = load i64, ptr %19, align 8, !tbaa !11
  %108 = add i64 %107, 4096
  %109 = load i64, ptr %20, align 8, !tbaa !11
  %110 = icmp ugt i64 %108, %109
  br i1 %110, label %111, label %117

111:                                              ; preds = %106
  %112 = load i64, ptr %20, align 8, !tbaa !11
  %113 = add i64 %112, 4096
  store i64 %113, ptr %20, align 8, !tbaa !11
  %114 = load ptr, ptr %18, align 8, !tbaa !5
  %115 = load i64, ptr %20, align 8, !tbaa !11
  %116 = call ptr @realloc(ptr noundef %114, i64 noundef %115) #12
  store ptr %116, ptr %18, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %111, %106
  %118 = load ptr, ptr %18, align 8, !tbaa !5
  %119 = load i64, ptr %19, align 8, !tbaa !11
  %120 = getelementptr inbounds i8, ptr %118, i64 %119
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = call ptr @fgets(ptr noundef %120, i32 noundef 4096, ptr noundef %121)
  %123 = load ptr, ptr %18, align 8, !tbaa !5
  %124 = load i64, ptr %19, align 8, !tbaa !11
  %125 = getelementptr inbounds i8, ptr %123, i64 %124
  %126 = call i64 @strlen(ptr noundef %125) #13
  store i64 %126, ptr %21, align 8, !tbaa !11
  %127 = load i64, ptr %21, align 8, !tbaa !11
  %128 = load i64, ptr %19, align 8, !tbaa !11
  %129 = add i64 %128, %127
  store i64 %129, ptr %19, align 8, !tbaa !11
  br label %130

130:                                              ; preds = %117
  %131 = load i64, ptr %21, align 8, !tbaa !11
  %132 = icmp ugt i64 %131, 0
  br i1 %132, label %133, label %141

133:                                              ; preds = %130
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  %135 = load i64, ptr %19, align 8, !tbaa !11
  %136 = sub i64 %135, 1
  %137 = getelementptr inbounds i8, ptr %134, i64 %136
  %138 = load i8, ptr %137, align 1, !tbaa !13
  %139 = sext i8 %138 to i32
  %140 = icmp ne i32 %139, 10
  br label %141

141:                                              ; preds = %133, %130
  %142 = phi i1 [ false, %130 ], [ %140, %133 ]
  br i1 %142, label %106, label %143, !llvm.loop !20

143:                                              ; preds = %141
  %144 = load i64, ptr %19, align 8, !tbaa !11
  %145 = icmp uge i64 %144, 2
  br i1 %145, label %146, label %173

146:                                              ; preds = %143
  %147 = load ptr, ptr %18, align 8, !tbaa !5
  %148 = load i64, ptr %19, align 8, !tbaa !11
  %149 = sub i64 %148, 2
  %150 = getelementptr inbounds i8, ptr %147, i64 %149
  %151 = load i8, ptr %150, align 1, !tbaa !13
  %152 = sext i8 %151 to i32
  %153 = icmp eq i32 %152, 13
  br i1 %153, label %154, label %173

154:                                              ; preds = %146
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = load i64, ptr %19, align 8, !tbaa !11
  %157 = sub i64 %156, 1
  %158 = getelementptr inbounds i8, ptr %155, i64 %157
  %159 = load i8, ptr %158, align 1, !tbaa !13
  %160 = sext i8 %159 to i32
  %161 = icmp eq i32 %160, 10
  br i1 %161, label %162, label %173

162:                                              ; preds = %154
  %163 = load ptr, ptr %18, align 8, !tbaa !5
  %164 = load i64, ptr %19, align 8, !tbaa !11
  %165 = sub i64 %164, 2
  %166 = getelementptr inbounds i8, ptr %163, i64 %165
  store i8 10, ptr %166, align 1, !tbaa !13
  %167 = load ptr, ptr %18, align 8, !tbaa !5
  %168 = load i64, ptr %19, align 8, !tbaa !11
  %169 = sub i64 %168, 1
  %170 = getelementptr inbounds i8, ptr %167, i64 %169
  store i8 0, ptr %170, align 1, !tbaa !13
  %171 = load i64, ptr %19, align 8, !tbaa !11
  %172 = add i64 %171, -1
  store i64 %172, ptr %19, align 8, !tbaa !11
  br label %173

173:                                              ; preds = %162, %154, %146, %143
  %174 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %174, ptr %17, align 8, !tbaa !5
  %175 = load ptr, ptr %17, align 8, !tbaa !5
  %176 = getelementptr inbounds i8, ptr %175, i64 0
  %177 = load i8, ptr %176, align 1, !tbaa !13
  store i8 %177, ptr %24, align 1, !tbaa !13
  %178 = load i32, ptr %23, align 4, !tbaa !9
  %179 = add i32 %178, 1
  store i32 %179, ptr %23, align 4, !tbaa !9
  %180 = load i8, ptr %24, align 1, !tbaa !13
  %181 = sext i8 %180 to i32
  switch i32 %181, label %579 [
    i32 116, label %182
    i32 118, label %187
    i32 101, label %245
    i32 35, label %511
    i32 10, label %584
    i32 13, label %584
  ]

182:                                              ; preds = %173
  store i32 0, ptr %25, align 4, !tbaa !9
  %183 = load ptr, ptr %10, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.database_t, ptr %183, i32 0, i32 1
  %185 = load i32, ptr %184, align 8, !tbaa !16
  %186 = add i32 %185, 1
  store i32 %186, ptr %184, align 8, !tbaa !16
  store i32 0, ptr %35, align 4, !tbaa !9
  store i32 0, ptr %37, align 4, !tbaa !9
  store i32 0, ptr %38, align 4, !tbaa !9
  store i32 0, ptr %39, align 4, !tbaa !9
  br label %584

187:                                              ; preds = %173
  %188 = load i32, ptr %25, align 4, !tbaa !9
  %189 = icmp eq i32 %188, 0
  br i1 %189, label %197, label %190

190:                                              ; preds = %187
  %191 = load i32, ptr %25, align 4, !tbaa !9
  %192 = icmp eq i32 %191, 1
  br i1 %192, label %197, label %193

193:                                              ; preds = %190
  %194 = load ptr, ptr @stderr, align 8, !tbaa !5
  %195 = load i32, ptr %23, align 4, !tbaa !9
  %196 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %194, ptr noundef @.str.28, i32 noundef %195) #11
  call void @exit(i32 noundef 1) #14
  unreachable

197:                                              ; preds = %190, %187
  store i32 1, ptr %25, align 4, !tbaa !9
  %198 = load ptr, ptr %17, align 8, !tbaa !5
  %199 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %198, ptr noundef @.str.29, ptr noundef %28, ptr noundef %29) #11
  store i32 %199, ptr %26, align 4, !tbaa !9
  %200 = load i32, ptr %26, align 4, !tbaa !9
  %201 = icmp slt i32 %200, 2
  br i1 %201, label %202, label %206

202:                                              ; preds = %197
  %203 = load ptr, ptr @stderr, align 8, !tbaa !5
  %204 = load i32, ptr %23, align 4, !tbaa !9
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef @.str.30, i32 noundef %204) #11
  call void @exit(i32 noundef 1) #14
  unreachable

206:                                              ; preds = %197
  %207 = load i32, ptr %28, align 4, !tbaa !9
  %208 = icmp ugt i32 %207, 65534
  br i1 %208, label %209, label %213

209:                                              ; preds = %206
  %210 = load ptr, ptr @stderr, align 8, !tbaa !5
  %211 = load i32, ptr %23, align 4, !tbaa !9
  %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.31, i32 noundef %211) #11
  call void @exit(i32 noundef 1) #14
  unreachable

213:                                              ; preds = %206
  %214 = load i32, ptr %38, align 4, !tbaa !9
  %215 = add i32 %214, 1
  store i32 %215, ptr %38, align 4, !tbaa !9
  %216 = load i32, ptr %28, align 4, !tbaa !9
  %217 = load i32, ptr %37, align 4, !tbaa !9
  %218 = icmp uge i32 %216, %217
  br i1 %218, label %219, label %233

219:                                              ; preds = %213
  %220 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %220, ptr %37, align 4, !tbaa !9
  %221 = load i32, ptr %40, align 4, !tbaa !9
  %222 = load i32, ptr %37, align 4, !tbaa !9
  %223 = icmp ule i32 %221, %222
  br i1 %223, label %224, label %232

224:                                              ; preds = %219
  %225 = load i32, ptr %37, align 4, !tbaa !9
  %226 = add i32 %225, 1000
  store i32 %226, ptr %40, align 4, !tbaa !9
  %227 = load ptr, ptr %46, align 8, !tbaa !5
  %228 = load i32, ptr %40, align 4, !tbaa !9
  %229 = zext i32 %228 to i64
  %230 = mul i64 %229, 4
  %231 = call ptr @realloc(ptr noundef %227, i64 noundef %230) #12
  store ptr %231, ptr %46, align 8, !tbaa !5
  br label %232

232:                                              ; preds = %224, %219
  br label %233

233:                                              ; preds = %232, %213
  %234 = load i32, ptr %29, align 4, !tbaa !9
  %235 = load ptr, ptr %46, align 8, !tbaa !5
  %236 = load i32, ptr %28, align 4, !tbaa !9
  %237 = zext i32 %236 to i64
  %238 = getelementptr inbounds i32, ptr %235, i64 %237
  store i32 %234, ptr %238, align 4, !tbaa !9
  %239 = load i32, ptr %29, align 4, !tbaa !9
  %240 = load i32, ptr %36, align 4, !tbaa !9
  %241 = icmp sgt i32 %239, %240
  br i1 %241, label %242, label %244

242:                                              ; preds = %233
  %243 = load i32, ptr %29, align 4, !tbaa !9
  store i32 %243, ptr %36, align 4, !tbaa !9
  br label %244

244:                                              ; preds = %242, %233
  br label %584

245:                                              ; preds = %173
  %246 = load i32, ptr %25, align 4, !tbaa !9
  %247 = icmp eq i32 %246, 1
  br i1 %247, label %255, label %248

248:                                              ; preds = %245
  %249 = load i32, ptr %25, align 4, !tbaa !9
  %250 = icmp eq i32 %249, 2
  br i1 %250, label %255, label %251

251:                                              ; preds = %248
  %252 = load ptr, ptr @stderr, align 8, !tbaa !5
  %253 = load i32, ptr %23, align 4, !tbaa !9
  %254 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %252, ptr noundef @.str.32, i32 noundef %253) #11
  call void @exit(i32 noundef 1) #14
  unreachable

255:                                              ; preds = %248, %245
  store i32 2, ptr %25, align 4, !tbaa !9
  %256 = load ptr, ptr %17, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.edge_label_t, ptr %32, i32 0, i32 0
  %258 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %256, ptr noundef @.str.33, ptr noundef %30, ptr noundef %31, ptr noundef %257, ptr noundef %27) #11
  store i32 %258, ptr %26, align 4, !tbaa !9
  %259 = load i32, ptr %27, align 4, !tbaa !9
  %260 = load ptr, ptr %17, align 8, !tbaa !5
  %261 = sext i32 %259 to i64
  %262 = getelementptr inbounds i8, ptr %260, i64 %261
  store ptr %262, ptr %17, align 8, !tbaa !5
  %263 = load i32, ptr %26, align 4, !tbaa !9
  %264 = icmp slt i32 %263, 3
  br i1 %264, label %265, label %269

265:                                              ; preds = %255
  %266 = load ptr, ptr @stderr, align 8, !tbaa !5
  %267 = load i32, ptr %23, align 4, !tbaa !9
  %268 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %266, ptr noundef @.str.34, i32 noundef %267) #11
  call void @exit(i32 noundef 1) #14
  unreachable

269:                                              ; preds = %255
  %270 = load i32, ptr %30, align 4, !tbaa !9
  %271 = load i32, ptr %38, align 4, !tbaa !9
  %272 = icmp uge i32 %270, %271
  br i1 %272, label %273, label %282

273:                                              ; preds = %269
  %274 = load ptr, ptr @stderr, align 8, !tbaa !5
  %275 = load i32, ptr %30, align 4, !tbaa !9
  %276 = load ptr, ptr %10, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.database_t, ptr %276, i32 0, i32 1
  %278 = load i32, ptr %277, align 8, !tbaa !16
  %279 = sub i32 %278, 1
  %280 = load i32, ptr %23, align 4, !tbaa !9
  %281 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %274, ptr noundef @.str.35, i32 noundef %275, i32 noundef %279, i32 noundef %280) #11
  call void @exit(i32 noundef 1) #14
  unreachable

282:                                              ; preds = %269
  %283 = load i32, ptr %31, align 4, !tbaa !9
  %284 = load i32, ptr %38, align 4, !tbaa !9
  %285 = icmp uge i32 %283, %284
  br i1 %285, label %286, label %295

286:                                              ; preds = %282
  %287 = load ptr, ptr @stderr, align 8, !tbaa !5
  %288 = load i32, ptr %31, align 4, !tbaa !9
  %289 = load ptr, ptr %10, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.database_t, ptr %289, i32 0, i32 1
  %291 = load i32, ptr %290, align 8, !tbaa !16
  %292 = sub i32 %291, 1
  %293 = load i32, ptr %23, align 4, !tbaa !9
  %294 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %287, ptr noundef @.str.35, i32 noundef %288, i32 noundef %292, i32 noundef %293) #11
  call void @exit(i32 noundef 1) #14
  unreachable

295:                                              ; preds = %282
  %296 = load i32, ptr %30, align 4, !tbaa !9
  %297 = load i32, ptr %31, align 4, !tbaa !9
  %298 = icmp eq i32 %296, %297
  br i1 %298, label %299, label %308

299:                                              ; preds = %295
  %300 = load ptr, ptr @stderr, align 8, !tbaa !5
  %301 = load i32, ptr %30, align 4, !tbaa !9
  %302 = load ptr, ptr %10, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.database_t, ptr %302, i32 0, i32 1
  %304 = load i32, ptr %303, align 8, !tbaa !16
  %305 = sub i32 %304, 1
  %306 = load i32, ptr %23, align 4, !tbaa !9
  %307 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %300, ptr noundef @.str.36, i32 noundef %301, i32 noundef %305, i32 noundef %306) #11
  call void @exit(i32 noundef 1) #14
  unreachable

308:                                              ; preds = %295
  %309 = load i32, ptr %11, align 4, !tbaa !9
  %310 = icmp ne i32 %309, 0
  br i1 %310, label %313, label %311

311:                                              ; preds = %308
  %312 = getelementptr inbounds %struct.edge_label_t, ptr %32, i32 0, i32 0
  store i32 0, ptr %312, align 4, !tbaa !21
  br label %313

313:                                              ; preds = %311, %308
  %314 = getelementptr inbounds %struct.edge_label_t, ptr %32, i32 0, i32 1
  store i32 0, ptr %314, align 4, !tbaa !23
  %315 = load i32, ptr %12, align 4, !tbaa !9
  %316 = icmp ne i32 %315, 0
  br i1 %316, label %317, label %338

317:                                              ; preds = %313
  %318 = load ptr, ptr %17, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.edge_label_t, ptr %32, i32 0, i32 1
  %320 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %318, ptr noundef @.str.37, ptr noundef %319, ptr noundef %27) #11
  store i32 %320, ptr %26, align 4, !tbaa !9
  %321 = load i32, ptr %27, align 4, !tbaa !9
  %322 = load ptr, ptr %17, align 8, !tbaa !5
  %323 = sext i32 %321 to i64
  %324 = getelementptr inbounds i8, ptr %322, i64 %323
  store ptr %324, ptr %17, align 8, !tbaa !5
  %325 = load i32, ptr %26, align 4, !tbaa !9
  %326 = icmp slt i32 %325, 1
  br i1 %326, label %327, label %337

327:                                              ; preds = %317
  %328 = load ptr, ptr @stderr, align 8, !tbaa !5
  %329 = load i32, ptr %30, align 4, !tbaa !9
  %330 = load i32, ptr %31, align 4, !tbaa !9
  %331 = load ptr, ptr %10, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.database_t, ptr %331, i32 0, i32 1
  %333 = load i32, ptr %332, align 8, !tbaa !16
  %334 = sub i32 %333, 1
  %335 = load i32, ptr %23, align 4, !tbaa !9
  %336 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %328, ptr noundef @.str.38, i32 noundef %329, i32 noundef %330, i32 noundef %334, i32 noundef %335) #11
  br label %337

337:                                              ; preds = %327, %317
  br label %338

338:                                              ; preds = %337, %313
  store i32 0, ptr %33, align 4, !tbaa !9
  %339 = load i32, ptr %13, align 4, !tbaa !9
  %340 = icmp ne i32 %339, 0
  br i1 %340, label %341, label %361

341:                                              ; preds = %338
  %342 = load ptr, ptr %17, align 8, !tbaa !5
  %343 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %342, ptr noundef @.str.39, ptr noundef %33, ptr noundef %27) #11
  store i32 %343, ptr %26, align 4, !tbaa !9
  %344 = load i32, ptr %27, align 4, !tbaa !9
  %345 = load ptr, ptr %17, align 8, !tbaa !5
  %346 = sext i32 %344 to i64
  %347 = getelementptr inbounds i8, ptr %345, i64 %346
  store ptr %347, ptr %17, align 8, !tbaa !5
  %348 = load i32, ptr %26, align 4, !tbaa !9
  %349 = icmp slt i32 %348, 1
  br i1 %349, label %350, label %360

350:                                              ; preds = %341
  %351 = load ptr, ptr @stderr, align 8, !tbaa !5
  %352 = load i32, ptr %30, align 4, !tbaa !9
  %353 = load i32, ptr %31, align 4, !tbaa !9
  %354 = load ptr, ptr %10, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.database_t, ptr %354, i32 0, i32 1
  %356 = load i32, ptr %355, align 8, !tbaa !16
  %357 = sub i32 %356, 1
  %358 = load i32, ptr %23, align 4, !tbaa !9
  %359 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %351, ptr noundef @.str.40, i32 noundef %352, i32 noundef %353, i32 noundef %357, i32 noundef %358) #11
  br label %360

360:                                              ; preds = %350, %341
  br label %361

361:                                              ; preds = %360, %338
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #11
  store i32 0, ptr %52, align 4, !tbaa !9
  br label %362

362:                                              ; preds = %408, %361
  %363 = load i32, ptr %52, align 4, !tbaa !9
  %364 = load ptr, ptr %45, align 8, !tbaa !5
  %365 = load i32, ptr %30, align 4, !tbaa !9
  %366 = zext i32 %365 to i64
  %367 = getelementptr inbounds i32, ptr %364, i64 %366
  %368 = load i32, ptr %367, align 4, !tbaa !9
  %369 = icmp ult i32 %363, %368
  br i1 %369, label %371, label %370

370:                                              ; preds = %362
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #11
  br label %411

371:                                              ; preds = %362
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #11
  %372 = load ptr, ptr %43, align 8, !tbaa !5
  %373 = load i32, ptr %30, align 4, !tbaa !9
  %374 = zext i32 %373 to i64
  %375 = getelementptr inbounds ptr, ptr %372, i64 %374
  %376 = load ptr, ptr %375, align 8, !tbaa !5
  %377 = load i32, ptr %52, align 4, !tbaa !9
  %378 = zext i32 %377 to i64
  %379 = getelementptr inbounds %struct.neighbor_t, ptr %376, i64 %378
  store ptr %379, ptr %53, align 8, !tbaa !5
  %380 = load ptr, ptr %53, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.neighbor_t, ptr %380, i32 0, i32 0
  %382 = load i16, ptr %381, align 4, !tbaa !24
  %383 = zext i16 %382 to i32
  %384 = load i32, ptr %31, align 4, !tbaa !9
  %385 = icmp eq i32 %383, %384
  br i1 %385, label %386, label %407

386:                                              ; preds = %371
  %387 = load ptr, ptr %53, align 8, !tbaa !5
  %388 = getelementptr inbounds %struct.neighbor_t, ptr %387, i32 0, i32 1
  %389 = call i32 @edge_label_compare(ptr noundef %388, ptr noundef %32)
  %390 = icmp eq i32 %389, 0
  br i1 %390, label %391, label %407

391:                                              ; preds = %386
  %392 = load i32, ptr %33, align 4, !tbaa !9
  %393 = load ptr, ptr %53, align 8, !tbaa !5
  %394 = getelementptr inbounds %struct.neighbor_t, ptr %393, i32 0, i32 2
  %395 = load i32, ptr %394, align 4, !tbaa !27
  %396 = icmp eq i32 %392, %395
  br i1 %396, label %397, label %407

397:                                              ; preds = %391
  %398 = load ptr, ptr @stderr, align 8, !tbaa !5
  %399 = load i32, ptr %30, align 4, !tbaa !9
  %400 = load i32, ptr %31, align 4, !tbaa !9
  %401 = load ptr, ptr %10, align 8, !tbaa !5
  %402 = getelementptr inbounds %struct.database_t, ptr %401, i32 0, i32 1
  %403 = load i32, ptr %402, align 8, !tbaa !16
  %404 = sub i32 %403, 1
  %405 = load i32, ptr %23, align 4, !tbaa !9
  %406 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %398, ptr noundef @.str.41, i32 noundef %399, i32 noundef %400, i32 noundef %404, i32 noundef %405) #11
  call void @exit(i32 noundef 1) #14
  unreachable

407:                                              ; preds = %391, %386, %371
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #11
  br label %408

408:                                              ; preds = %407
  %409 = load i32, ptr %52, align 4, !tbaa !9
  %410 = add i32 %409, 1
  store i32 %410, ptr %52, align 4, !tbaa !9
  br label %362, !llvm.loop !28

411:                                              ; preds = %370
  %412 = load i32, ptr %31, align 4, !tbaa !9
  %413 = trunc i32 %412 to i16
  %414 = load ptr, ptr %43, align 8, !tbaa !5
  %415 = load i32, ptr %30, align 4, !tbaa !9
  %416 = zext i32 %415 to i64
  %417 = getelementptr inbounds ptr, ptr %414, i64 %416
  %418 = load ptr, ptr %417, align 8, !tbaa !5
  %419 = load ptr, ptr %45, align 8, !tbaa !5
  %420 = load i32, ptr %30, align 4, !tbaa !9
  %421 = zext i32 %420 to i64
  %422 = getelementptr inbounds i32, ptr %419, i64 %421
  %423 = load i32, ptr %422, align 4, !tbaa !9
  %424 = zext i32 %423 to i64
  %425 = getelementptr inbounds %struct.neighbor_t, ptr %418, i64 %424
  %426 = getelementptr inbounds %struct.neighbor_t, ptr %425, i32 0, i32 0
  store i16 %413, ptr %426, align 4, !tbaa !24
  %427 = load ptr, ptr %43, align 8, !tbaa !5
  %428 = load i32, ptr %30, align 4, !tbaa !9
  %429 = zext i32 %428 to i64
  %430 = getelementptr inbounds ptr, ptr %427, i64 %429
  %431 = load ptr, ptr %430, align 8, !tbaa !5
  %432 = load ptr, ptr %45, align 8, !tbaa !5
  %433 = load i32, ptr %30, align 4, !tbaa !9
  %434 = zext i32 %433 to i64
  %435 = getelementptr inbounds i32, ptr %432, i64 %434
  %436 = load i32, ptr %435, align 4, !tbaa !9
  %437 = zext i32 %436 to i64
  %438 = getelementptr inbounds %struct.neighbor_t, ptr %431, i64 %437
  %439 = getelementptr inbounds %struct.neighbor_t, ptr %438, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %439, ptr align 4 %32, i64 8, i1 false), !tbaa.struct !29
  %440 = load i32, ptr %33, align 4, !tbaa !9
  %441 = load ptr, ptr %43, align 8, !tbaa !5
  %442 = load i32, ptr %30, align 4, !tbaa !9
  %443 = zext i32 %442 to i64
  %444 = getelementptr inbounds ptr, ptr %441, i64 %443
  %445 = load ptr, ptr %444, align 8, !tbaa !5
  %446 = load ptr, ptr %45, align 8, !tbaa !5
  %447 = load i32, ptr %30, align 4, !tbaa !9
  %448 = zext i32 %447 to i64
  %449 = getelementptr inbounds i32, ptr %446, i64 %448
  %450 = load i32, ptr %449, align 4, !tbaa !9
  %451 = zext i32 %450 to i64
  %452 = getelementptr inbounds %struct.neighbor_t, ptr %445, i64 %451
  %453 = getelementptr inbounds %struct.neighbor_t, ptr %452, i32 0, i32 2
  store i32 %440, ptr %453, align 4, !tbaa !27
  %454 = load i32, ptr %30, align 4, !tbaa !9
  %455 = trunc i32 %454 to i16
  %456 = load ptr, ptr %43, align 8, !tbaa !5
  %457 = load i32, ptr %31, align 4, !tbaa !9
  %458 = zext i32 %457 to i64
  %459 = getelementptr inbounds ptr, ptr %456, i64 %458
  %460 = load ptr, ptr %459, align 8, !tbaa !5
  %461 = load ptr, ptr %45, align 8, !tbaa !5
  %462 = load i32, ptr %31, align 4, !tbaa !9
  %463 = zext i32 %462 to i64
  %464 = getelementptr inbounds i32, ptr %461, i64 %463
  %465 = load i32, ptr %464, align 4, !tbaa !9
  %466 = zext i32 %465 to i64
  %467 = getelementptr inbounds %struct.neighbor_t, ptr %460, i64 %466
  %468 = getelementptr inbounds %struct.neighbor_t, ptr %467, i32 0, i32 0
  store i16 %455, ptr %468, align 4, !tbaa !24
  %469 = load ptr, ptr %43, align 8, !tbaa !5
  %470 = load i32, ptr %31, align 4, !tbaa !9
  %471 = zext i32 %470 to i64
  %472 = getelementptr inbounds ptr, ptr %469, i64 %471
  %473 = load ptr, ptr %472, align 8, !tbaa !5
  %474 = load ptr, ptr %45, align 8, !tbaa !5
  %475 = load i32, ptr %31, align 4, !tbaa !9
  %476 = zext i32 %475 to i64
  %477 = getelementptr inbounds i32, ptr %474, i64 %476
  %478 = load i32, ptr %477, align 4, !tbaa !9
  %479 = zext i32 %478 to i64
  %480 = getelementptr inbounds %struct.neighbor_t, ptr %473, i64 %479
  %481 = getelementptr inbounds %struct.neighbor_t, ptr %480, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %481, ptr align 4 %32, i64 8, i1 false), !tbaa.struct !29
  %482 = load i32, ptr %33, align 4, !tbaa !9
  %483 = call i32 @invert_direction(i32 noundef %482)
  %484 = load ptr, ptr %43, align 8, !tbaa !5
  %485 = load i32, ptr %31, align 4, !tbaa !9
  %486 = zext i32 %485 to i64
  %487 = getelementptr inbounds ptr, ptr %484, i64 %486
  %488 = load ptr, ptr %487, align 8, !tbaa !5
  %489 = load ptr, ptr %45, align 8, !tbaa !5
  %490 = load i32, ptr %31, align 4, !tbaa !9
  %491 = zext i32 %490 to i64
  %492 = getelementptr inbounds i32, ptr %489, i64 %491
  %493 = load i32, ptr %492, align 4, !tbaa !9
  %494 = zext i32 %493 to i64
  %495 = getelementptr inbounds %struct.neighbor_t, ptr %488, i64 %494
  %496 = getelementptr inbounds %struct.neighbor_t, ptr %495, i32 0, i32 2
  store i32 %483, ptr %496, align 4, !tbaa !27
  %497 = load ptr, ptr %45, align 8, !tbaa !5
  %498 = load i32, ptr %30, align 4, !tbaa !9
  %499 = zext i32 %498 to i64
  %500 = getelementptr inbounds i32, ptr %497, i64 %499
  %501 = load i32, ptr %500, align 4, !tbaa !9
  %502 = add i32 %501, 1
  store i32 %502, ptr %500, align 4, !tbaa !9
  %503 = load ptr, ptr %45, align 8, !tbaa !5
  %504 = load i32, ptr %31, align 4, !tbaa !9
  %505 = zext i32 %504 to i64
  %506 = getelementptr inbounds i32, ptr %503, i64 %505
  %507 = load i32, ptr %506, align 4, !tbaa !9
  %508 = add i32 %507, 1
  store i32 %508, ptr %506, align 4, !tbaa !9
  %509 = load i32, ptr %39, align 4, !tbaa !9
  %510 = add i32 %509, 1
  store i32 %510, ptr %39, align 4, !tbaa !9
  br label %584

511:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #11
  store ptr @.str.42, ptr %54, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4096, ptr %55) #11
  %512 = load ptr, ptr %49, align 8, !tbaa !5
  %513 = icmp ne ptr %512, null
  br i1 %513, label %514, label %571

514:                                              ; preds = %511
  %515 = load ptr, ptr %17, align 8, !tbaa !5
  %516 = load ptr, ptr %54, align 8, !tbaa !5
  %517 = load ptr, ptr %54, align 8, !tbaa !5
  %518 = call i64 @strlen(ptr noundef %517) #13
  %519 = call i32 @strncmp(ptr noundef %515, ptr noundef %516, i64 noundef %518) #13
  %520 = icmp eq i32 %519, 0
  br i1 %520, label %521, label %571

521:                                              ; preds = %514
  %522 = getelementptr inbounds [4096 x i8], ptr %55, i64 0, i64 0
  %523 = load ptr, ptr %17, align 8, !tbaa !5
  %524 = load ptr, ptr %54, align 8, !tbaa !5
  %525 = call i64 @strlen(ptr noundef %524) #13
  %526 = getelementptr inbounds i8, ptr %523, i64 %525
  %527 = call ptr @strncpy(ptr noundef %522, ptr noundef %526, i64 noundef 4096) #11
  %528 = getelementptr inbounds [4096 x i8], ptr %55, i64 0, i64 0
  %529 = call i64 @strlen(ptr noundef %528) #13
  %530 = sub i64 %529, 1
  %531 = getelementptr inbounds [4096 x i8], ptr %55, i64 0, i64 %530
  store i8 0, ptr %531, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #11
  %532 = getelementptr inbounds [4096 x i8], ptr %55, i64 0, i64 0
  %533 = load ptr, ptr %47, align 8, !tbaa !5
  %534 = call ptr @strtok(ptr noundef %532, ptr noundef %533) #11
  store ptr %534, ptr %56, align 8, !tbaa !5
  br label %535

535:                                              ; preds = %567, %521
  %536 = load ptr, ptr %56, align 8, !tbaa !5
  %537 = icmp ne ptr %536, null
  br i1 %537, label %538, label %570

538:                                              ; preds = %535
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #11
  store i32 0, ptr %57, align 4, !tbaa !9
  br label %539

539:                                              ; preds = %559, %538
  %540 = load i32, ptr %57, align 4, !tbaa !9
  %541 = load i32, ptr %50, align 4, !tbaa !9
  %542 = icmp ult i32 %540, %541
  br i1 %542, label %544, label %543

543:                                              ; preds = %539
  store i32 14, ptr %58, align 4
  br label %562

544:                                              ; preds = %539
  %545 = load ptr, ptr %49, align 8, !tbaa !5
  %546 = load i32, ptr %57, align 4, !tbaa !9
  %547 = zext i32 %546 to i64
  %548 = getelementptr inbounds ptr, ptr %545, i64 %547
  %549 = load ptr, ptr %548, align 8, !tbaa !5
  %550 = load ptr, ptr %56, align 8, !tbaa !5
  %551 = call i32 @strcmp(ptr noundef %549, ptr noundef %550) #13
  %552 = icmp eq i32 %551, 0
  br i1 %552, label %553, label %558

553:                                              ; preds = %544
  store i32 1, ptr %35, align 4, !tbaa !9
  %554 = load ptr, ptr %10, align 8, !tbaa !5
  %555 = getelementptr inbounds %struct.database_t, ptr %554, i32 0, i32 2
  %556 = load i32, ptr %555, align 4, !tbaa !14
  %557 = add i32 %556, 1
  store i32 %557, ptr %555, align 4, !tbaa !14
  store i32 14, ptr %58, align 4
  br label %562

558:                                              ; preds = %544
  br label %559

559:                                              ; preds = %558
  %560 = load i32, ptr %57, align 4, !tbaa !9
  %561 = add i32 %560, 1
  store i32 %561, ptr %57, align 4, !tbaa !9
  br label %539, !llvm.loop !30

562:                                              ; preds = %553, %543
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #11
  br label %563

563:                                              ; preds = %562
  %564 = load i32, ptr %35, align 4, !tbaa !9
  %565 = icmp ne i32 %564, 0
  br i1 %565, label %566, label %567

566:                                              ; preds = %563
  br label %570

567:                                              ; preds = %563
  %568 = load ptr, ptr %47, align 8, !tbaa !5
  %569 = call ptr @strtok(ptr noundef null, ptr noundef %568) #11
  store ptr %569, ptr %56, align 8, !tbaa !5
  br label %535, !llvm.loop !31

570:                                              ; preds = %566, %535
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #11
  br label %571

571:                                              ; preds = %570, %514, %511
  %572 = load i32, ptr %14, align 4, !tbaa !9
  %573 = icmp ne i32 %572, 0
  br i1 %573, label %574, label %578

574:                                              ; preds = %571
  %575 = load ptr, ptr %16, align 8, !tbaa !5
  %576 = load ptr, ptr %17, align 8, !tbaa !5
  %577 = load i64, ptr %19, align 8, !tbaa !11
  call void @write_header_entry(ptr noundef %575, ptr noundef %576, i64 noundef %577)
  br label %578

578:                                              ; preds = %574, %571
  call void @llvm.lifetime.end.p0(i64 4096, ptr %55) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #11
  br label %584

579:                                              ; preds = %173
  %580 = load ptr, ptr @stderr, align 8, !tbaa !5
  %581 = load ptr, ptr %17, align 8, !tbaa !5
  %582 = load i32, ptr %23, align 4, !tbaa !9
  %583 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %580, ptr noundef @.str.43, ptr noundef %581, i32 noundef %582) #11
  call void @exit(i32 noundef 1) #14
  unreachable

584:                                              ; preds = %578, %411, %244, %182, %173, %173
  %585 = load ptr, ptr %9, align 8, !tbaa !5
  %586 = call i32 @fgetc(ptr noundef %585)
  %587 = trunc i32 %586 to i8
  store i8 %587, ptr %24, align 1, !tbaa !13
  %588 = load i8, ptr %24, align 1, !tbaa !13
  %589 = sext i8 %588 to i32
  %590 = load ptr, ptr %9, align 8, !tbaa !5
  %591 = call i32 @ungetc(i32 noundef %589, ptr noundef %590)
  %592 = load i32, ptr %25, align 4, !tbaa !9
  %593 = icmp eq i32 %592, 1
  br i1 %593, label %594, label %675

594:                                              ; preds = %584
  %595 = load i8, ptr %24, align 1, !tbaa !13
  %596 = sext i8 %595 to i32
  %597 = icmp ne i32 %596, 118
  br i1 %597, label %598, label %675

598:                                              ; preds = %594
  %599 = load i8, ptr %24, align 1, !tbaa !13
  %600 = sext i8 %599 to i32
  %601 = icmp ne i32 %600, 35
  br i1 %601, label %602, label %675

602:                                              ; preds = %598
  %603 = load i32, ptr %37, align 4, !tbaa !9
  %604 = add i32 %603, 1
  %605 = load i32, ptr %38, align 4, !tbaa !9
  %606 = icmp ne i32 %604, %605
  br i1 %606, label %607, label %616

607:                                              ; preds = %602
  %608 = load ptr, ptr @stderr, align 8, !tbaa !5
  %609 = load ptr, ptr %10, align 8, !tbaa !5
  %610 = getelementptr inbounds %struct.database_t, ptr %609, i32 0, i32 1
  %611 = load i32, ptr %610, align 8, !tbaa !16
  %612 = sub i32 %611, 1
  %613 = load i32, ptr %38, align 4, !tbaa !9
  %614 = load i32, ptr %37, align 4, !tbaa !9
  %615 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %608, ptr noundef @.str.44, i32 noundef %612, i32 noundef %613, i32 noundef %614) #11
  call void @exit(i32 noundef 1) #14
  unreachable

616:                                              ; preds = %602
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #11
  %617 = load i32, ptr %38, align 4, !tbaa !9
  %618 = load i32, ptr %38, align 4, !tbaa !9
  %619 = mul i32 %617, %618
  %620 = zext i32 %619 to i64
  store i64 %620, ptr %59, align 8, !tbaa !11
  %621 = load i64, ptr %59, align 8, !tbaa !11
  %622 = load i32, ptr %42, align 4, !tbaa !9
  %623 = zext i32 %622 to i64
  %624 = icmp ugt i64 %621, %623
  br i1 %624, label %625, label %633

625:                                              ; preds = %616
  %626 = load ptr, ptr %44, align 8, !tbaa !5
  call void @free(ptr noundef %626) #11
  %627 = load i64, ptr %59, align 8, !tbaa !11
  %628 = trunc i64 %627 to i32
  store i32 %628, ptr %42, align 4, !tbaa !9
  %629 = load i32, ptr %42, align 4, !tbaa !9
  %630 = zext i32 %629 to i64
  %631 = mul i64 %630, 16
  %632 = call noalias ptr @malloc(i64 noundef %631) #15
  store ptr %632, ptr %44, align 8, !tbaa !5
  br label %633

633:                                              ; preds = %625, %616
  %634 = load i32, ptr %40, align 4, !tbaa !9
  %635 = load i32, ptr %41, align 4, !tbaa !9
  %636 = icmp ugt i32 %634, %635
  br i1 %636, label %637, label %649

637:                                              ; preds = %633
  %638 = load ptr, ptr %43, align 8, !tbaa !5
  call void @free(ptr noundef %638) #11
  %639 = load ptr, ptr %45, align 8, !tbaa !5
  call void @free(ptr noundef %639) #11
  %640 = load i32, ptr %40, align 4, !tbaa !9
  store i32 %640, ptr %41, align 4, !tbaa !9
  %641 = load i32, ptr %40, align 4, !tbaa !9
  %642 = zext i32 %641 to i64
  %643 = mul i64 %642, 8
  %644 = call noalias ptr @malloc(i64 noundef %643) #15
  store ptr %644, ptr %43, align 8, !tbaa !5
  %645 = load i32, ptr %40, align 4, !tbaa !9
  %646 = zext i32 %645 to i64
  %647 = mul i64 %646, 4
  %648 = call noalias ptr @malloc(i64 noundef %647) #15
  store ptr %648, ptr %45, align 8, !tbaa !5
  br label %649

649:                                              ; preds = %637, %633
  %650 = load ptr, ptr %45, align 8, !tbaa !5
  %651 = load i32, ptr %38, align 4, !tbaa !9
  %652 = zext i32 %651 to i64
  %653 = mul i64 %652, 4
  call void @llvm.memset.p0.i64(ptr align 4 %650, i8 0, i64 %653, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #11
  store i64 0, ptr %60, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %61) #11
  store i32 0, ptr %61, align 4, !tbaa !9
  br label %654

654:                                              ; preds = %671, %649
  %655 = load i32, ptr %61, align 4, !tbaa !9
  %656 = load i32, ptr %38, align 4, !tbaa !9
  %657 = icmp ult i32 %655, %656
  br i1 %657, label %659, label %658

658:                                              ; preds = %654
  store i32 17, ptr %58, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %61) #11
  br label %674

659:                                              ; preds = %654
  %660 = load ptr, ptr %44, align 8, !tbaa !5
  %661 = load i64, ptr %60, align 8, !tbaa !11
  %662 = getelementptr inbounds %struct.neighbor_t, ptr %660, i64 %661
  %663 = load ptr, ptr %43, align 8, !tbaa !5
  %664 = load i32, ptr %61, align 4, !tbaa !9
  %665 = zext i32 %664 to i64
  %666 = getelementptr inbounds ptr, ptr %663, i64 %665
  store ptr %662, ptr %666, align 8, !tbaa !5
  %667 = load i32, ptr %38, align 4, !tbaa !9
  %668 = zext i32 %667 to i64
  %669 = load i64, ptr %60, align 8, !tbaa !11
  %670 = add i64 %669, %668
  store i64 %670, ptr %60, align 8, !tbaa !11
  br label %671

671:                                              ; preds = %659
  %672 = load i32, ptr %61, align 4, !tbaa !9
  %673 = add i32 %672, 1
  store i32 %673, ptr %61, align 4, !tbaa !9
  br label %654, !llvm.loop !32

674:                                              ; preds = %658
  store i32 2, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #11
  br label %803

675:                                              ; preds = %598, %594, %584
  %676 = load i32, ptr %25, align 4, !tbaa !9
  %677 = icmp eq i32 %676, 2
  br i1 %677, label %678, label %802

678:                                              ; preds = %675
  %679 = load i8, ptr %24, align 1, !tbaa !13
  %680 = sext i8 %679 to i32
  %681 = icmp ne i32 %680, 101
  br i1 %681, label %682, label %802

682:                                              ; preds = %678
  %683 = load i8, ptr %24, align 1, !tbaa !13
  %684 = sext i8 %683 to i32
  %685 = icmp ne i32 %684, 35
  br i1 %685, label %686, label %802

686:                                              ; preds = %682
  %687 = load ptr, ptr %10, align 8, !tbaa !5
  %688 = getelementptr inbounds %struct.database_t, ptr %687, i32 0, i32 0
  %689 = load ptr, ptr %688, align 8, !tbaa !17
  %690 = load ptr, ptr %10, align 8, !tbaa !5
  %691 = getelementptr inbounds %struct.database_t, ptr %690, i32 0, i32 1
  %692 = load i32, ptr %691, align 8, !tbaa !16
  %693 = zext i32 %692 to i64
  %694 = mul i64 %693, 40
  %695 = call ptr @realloc(ptr noundef %689, i64 noundef %694) #12
  %696 = load ptr, ptr %10, align 8, !tbaa !5
  %697 = getelementptr inbounds %struct.database_t, ptr %696, i32 0, i32 0
  store ptr %695, ptr %697, align 8, !tbaa !17
  %698 = load ptr, ptr %10, align 8, !tbaa !5
  %699 = getelementptr inbounds %struct.database_t, ptr %698, i32 0, i32 0
  %700 = load ptr, ptr %699, align 8, !tbaa !17
  %701 = load ptr, ptr %10, align 8, !tbaa !5
  %702 = getelementptr inbounds %struct.database_t, ptr %701, i32 0, i32 1
  %703 = load i32, ptr %702, align 8, !tbaa !16
  %704 = zext i32 %703 to i64
  %705 = getelementptr inbounds %struct.database_entry_t, ptr %700, i64 %704
  %706 = getelementptr inbounds %struct.database_entry_t, ptr %705, i64 -1
  store ptr %706, ptr %34, align 8, !tbaa !5
  %707 = load ptr, ptr %10, align 8, !tbaa !5
  %708 = getelementptr inbounds %struct.database_t, ptr %707, i32 0, i32 1
  %709 = load i32, ptr %708, align 8, !tbaa !16
  %710 = sub i32 %709, 1
  %711 = load ptr, ptr %34, align 8, !tbaa !5
  %712 = getelementptr inbounds %struct.database_entry_t, ptr %711, i32 0, i32 3
  store i32 %710, ptr %712, align 8, !tbaa !33
  %713 = load i32, ptr %35, align 4, !tbaa !9
  %714 = load ptr, ptr %34, align 8, !tbaa !5
  %715 = getelementptr inbounds %struct.database_entry_t, ptr %714, i32 0, i32 4
  store i32 %713, ptr %715, align 4, !tbaa !35
  %716 = load i32, ptr %38, align 4, !tbaa !9
  %717 = load ptr, ptr %34, align 8, !tbaa !5
  %718 = getelementptr inbounds %struct.database_entry_t, ptr %717, i32 0, i32 5
  store i32 %716, ptr %718, align 8, !tbaa !36
  %719 = load i32, ptr %39, align 4, !tbaa !9
  %720 = load ptr, ptr %34, align 8, !tbaa !5
  %721 = getelementptr inbounds %struct.database_entry_t, ptr %720, i32 0, i32 6
  store i32 %719, ptr %721, align 4, !tbaa !37
  %722 = load i32, ptr %38, align 4, !tbaa !9
  %723 = zext i32 %722 to i64
  %724 = mul i64 %723, 4
  %725 = call noalias ptr @malloc(i64 noundef %724) #15
  %726 = load ptr, ptr %34, align 8, !tbaa !5
  %727 = getelementptr inbounds %struct.database_entry_t, ptr %726, i32 0, i32 0
  store ptr %725, ptr %727, align 8, !tbaa !38
  %728 = load ptr, ptr %34, align 8, !tbaa !5
  %729 = getelementptr inbounds %struct.database_entry_t, ptr %728, i32 0, i32 0
  %730 = load ptr, ptr %729, align 8, !tbaa !38
  %731 = load ptr, ptr %46, align 8, !tbaa !5
  %732 = load i32, ptr %38, align 4, !tbaa !9
  %733 = zext i32 %732 to i64
  %734 = mul i64 %733, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %730, ptr align 4 %731, i64 %734, i1 false)
  %735 = load i32, ptr %38, align 4, !tbaa !9
  %736 = zext i32 %735 to i64
  %737 = mul i64 %736, 4
  %738 = call noalias ptr @malloc(i64 noundef %737) #15
  %739 = load ptr, ptr %34, align 8, !tbaa !5
  %740 = getelementptr inbounds %struct.database_entry_t, ptr %739, i32 0, i32 1
  store ptr %738, ptr %740, align 8, !tbaa !39
  %741 = load ptr, ptr %34, align 8, !tbaa !5
  %742 = getelementptr inbounds %struct.database_entry_t, ptr %741, i32 0, i32 1
  %743 = load ptr, ptr %742, align 8, !tbaa !39
  %744 = load ptr, ptr %45, align 8, !tbaa !5
  %745 = load i32, ptr %38, align 4, !tbaa !9
  %746 = zext i32 %745 to i64
  %747 = mul i64 %746, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %743, ptr align 4 %744, i64 %747, i1 false)
  %748 = load i32, ptr %38, align 4, !tbaa !9
  %749 = zext i32 %748 to i64
  %750 = mul i64 %749, 8
  %751 = call noalias ptr @malloc(i64 noundef %750) #15
  %752 = load ptr, ptr %34, align 8, !tbaa !5
  %753 = getelementptr inbounds %struct.database_entry_t, ptr %752, i32 0, i32 2
  store ptr %751, ptr %753, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 8, ptr %62) #11
  %754 = load i32, ptr %39, align 4, !tbaa !9
  %755 = mul i32 %754, 2
  %756 = zext i32 %755 to i64
  %757 = mul i64 %756, 16
  %758 = call noalias ptr @malloc(i64 noundef %757) #15
  store ptr %758, ptr %62, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %63) #11
  store i32 0, ptr %63, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %64) #11
  store i32 0, ptr %64, align 4, !tbaa !9
  br label %759

759:                                              ; preds = %798, %686
  %760 = load i32, ptr %64, align 4, !tbaa !9
  %761 = load i32, ptr %38, align 4, !tbaa !9
  %762 = icmp ult i32 %760, %761
  br i1 %762, label %764, label %763

763:                                              ; preds = %759
  store i32 20, ptr %58, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %64) #11
  br label %801

764:                                              ; preds = %759
  %765 = load ptr, ptr %62, align 8, !tbaa !5
  %766 = load i32, ptr %63, align 4, !tbaa !9
  %767 = zext i32 %766 to i64
  %768 = getelementptr inbounds %struct.neighbor_t, ptr %765, i64 %767
  %769 = load ptr, ptr %34, align 8, !tbaa !5
  %770 = getelementptr inbounds %struct.database_entry_t, ptr %769, i32 0, i32 2
  %771 = load ptr, ptr %770, align 8, !tbaa !40
  %772 = load i32, ptr %64, align 4, !tbaa !9
  %773 = zext i32 %772 to i64
  %774 = getelementptr inbounds ptr, ptr %771, i64 %773
  store ptr %768, ptr %774, align 8, !tbaa !5
  %775 = load ptr, ptr %62, align 8, !tbaa !5
  %776 = load i32, ptr %63, align 4, !tbaa !9
  %777 = zext i32 %776 to i64
  %778 = getelementptr inbounds %struct.neighbor_t, ptr %775, i64 %777
  %779 = load ptr, ptr %43, align 8, !tbaa !5
  %780 = load i32, ptr %64, align 4, !tbaa !9
  %781 = zext i32 %780 to i64
  %782 = getelementptr inbounds ptr, ptr %779, i64 %781
  %783 = load ptr, ptr %782, align 8, !tbaa !5
  %784 = load ptr, ptr %45, align 8, !tbaa !5
  %785 = load i32, ptr %64, align 4, !tbaa !9
  %786 = zext i32 %785 to i64
  %787 = getelementptr inbounds i32, ptr %784, i64 %786
  %788 = load i32, ptr %787, align 4, !tbaa !9
  %789 = zext i32 %788 to i64
  %790 = mul i64 %789, 16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %778, ptr align 4 %783, i64 %790, i1 false)
  %791 = load ptr, ptr %45, align 8, !tbaa !5
  %792 = load i32, ptr %64, align 4, !tbaa !9
  %793 = zext i32 %792 to i64
  %794 = getelementptr inbounds i32, ptr %791, i64 %793
  %795 = load i32, ptr %794, align 4, !tbaa !9
  %796 = load i32, ptr %63, align 4, !tbaa !9
  %797 = add i32 %796, %795
  store i32 %797, ptr %63, align 4, !tbaa !9
  br label %798

798:                                              ; preds = %764
  %799 = load i32, ptr %64, align 4, !tbaa !9
  %800 = add i32 %799, 1
  store i32 %800, ptr %64, align 4, !tbaa !9
  br label %759, !llvm.loop !41

801:                                              ; preds = %763
  store i32 0, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %62) #11
  br label %802

802:                                              ; preds = %801, %682, %678, %675
  br label %803

803:                                              ; preds = %802, %674
  br label %100, !llvm.loop !42

804:                                              ; preds = %100
  %805 = load ptr, ptr %46, align 8, !tbaa !5
  call void @free(ptr noundef %805) #11
  %806 = load ptr, ptr %43, align 8, !tbaa !5
  call void @free(ptr noundef %806) #11
  %807 = load ptr, ptr %45, align 8, !tbaa !5
  call void @free(ptr noundef %807) #11
  %808 = load ptr, ptr %44, align 8, !tbaa !5
  call void @free(ptr noundef %808) #11
  %809 = load ptr, ptr %49, align 8, !tbaa !5
  call void @free(ptr noundef %809) #11
  %810 = load ptr, ptr %48, align 8, !tbaa !5
  call void @free(ptr noundef %810) #11
  %811 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %811) #11
  %812 = load ptr, ptr %10, align 8, !tbaa !5
  %813 = getelementptr inbounds %struct.database_t, ptr %812, i32 0, i32 0
  %814 = load ptr, ptr %813, align 8, !tbaa !17
  %815 = load ptr, ptr %10, align 8, !tbaa !5
  %816 = getelementptr inbounds %struct.database_t, ptr %815, i32 0, i32 1
  %817 = load i32, ptr %816, align 8, !tbaa !16
  %818 = zext i32 %817 to i64
  call void @qsort(ptr noundef %814, i64 noundef %818, i64 noundef 40, ptr noundef @database_entry_vertex_size_compare)
  %819 = load i32, ptr %36, align 4, !tbaa !9
  %820 = add nsw i32 %819, 1
  %821 = load ptr, ptr %10, align 8, !tbaa !5
  %822 = getelementptr inbounds %struct.database_t, ptr %821, i32 0, i32 3
  store i32 %820, ptr %822, align 8, !tbaa !43
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #11
  ret void
}

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #3

; Function Attrs: nounwind
declare ptr @strtok(ptr noundef, ptr noundef) #3

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #10

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #10

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #10

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { "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 = { nounwind allocsize(1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { inlinehint 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 #9 = { 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 #10 = { nounwind willreturn memory(read) "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 #11 = { nounwind }
attributes #12 = { nounwind allocsize(1) }
attributes #13 = { nounwind willreturn memory(read) }
attributes #14 = { noreturn nounwind }
attributes #15 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 12}
!15 = !{!"database_t", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!16 = !{!15, !10, i64 8}
!17 = !{!15, !6, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!22, !10, i64 0}
!22 = !{!"edge_label_t", !10, i64 0, !10, i64 4}
!23 = !{!22, !10, i64 4}
!24 = !{!25, !26, i64 0}
!25 = !{!"neighbor_t", !26, i64 0, !22, i64 4, !10, i64 12}
!26 = !{!"short", !7, i64 0}
!27 = !{!25, !10, i64 12}
!28 = distinct !{!28, !19}
!29 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!30 = distinct !{!30, !19}
!31 = distinct !{!31, !19}
!32 = distinct !{!32, !19}
!33 = !{!34, !10, i64 24}
!34 = !{!"database_entry_t", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!35 = !{!34, !10, i64 28}
!36 = !{!34, !10, i64 32}
!37 = !{!34, !10, i64 36}
!38 = !{!34, !6, i64 0}
!39 = !{!34, !6, i64 8}
!40 = !{!34, !6, i64 16}
!41 = distinct !{!41, !19}
!42 = distinct !{!42, !19}
!43 = !{!15, !10, i64 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.edge_label_t = type { i32, i32 }
%struct.neighbor_t = type { i16, %struct.edge_label_t, i32 }
%struct.database_entry_t = type { ptr, ptr, ptr, i32, i32, i32, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.27 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [80 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @feof(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fgetc(ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @invert_direction(i32 noundef) local_unnamed_addr #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @edge_label_compare(ptr noundef, ptr noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
declare dso_local void @write_header_entry(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #9

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

; Function Attrs: nounwind uwtable
define dso_local void @read_database_file(ptr nocapture noundef %0, ptr nocapture noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef readonly %6, ptr noundef %7) local_unnamed_addr #9 {
  %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 %struct.edge_label_t, align 8
  %15 = alloca i32, align 4
  %16 = alloca [4096 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #16
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #16
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #16
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #16
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #16
  store i64 0, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #16
  %17 = getelementptr inbounds i8, ptr %1, i64 12
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  %.not = icmp eq ptr %6, null
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %1, i8 0, i64 16, i1 false)
  br i1 %.not, label %.loopexit333, label %19

19:                                               ; preds = %8
  %20 = tail call noalias ptr @strdup(ptr noundef nonnull %6) #16
  %21 = tail call ptr @strtok(ptr noundef %20, ptr noundef nonnull @.str.27) #16
  %.not311434 = icmp eq ptr %21, null
  br i1 %.not311434, label %.loopexit333, label %.lr.ph

.lr.ph:                                           ; preds = %19, %.lr.ph
  %.0257437 = phi ptr [ %28, %.lr.ph ], [ %21, %19 ]
  %.0258436 = phi i32 [ %22, %.lr.ph ], [ 0, %19 ]
  %.0260435 = phi ptr [ %25, %.lr.ph ], [ null, %19 ]
  %22 = add i32 %.0258436, 1
  %23 = zext i32 %22 to i64
  %24 = shl nuw nsw i64 %23, 3
  %25 = tail call ptr @realloc(ptr noundef %.0260435, i64 noundef %24) #17
  %26 = zext i32 %.0258436 to i64
  %27 = getelementptr inbounds ptr, ptr %25, i64 %26
  store ptr %.0257437, ptr %27, align 8, !tbaa !9
  %28 = tail call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.27) #16
  %.not311 = icmp eq ptr %28, null
  br i1 %.not311, label %.loopexit333, label %.lr.ph, !llvm.loop !11

.loopexit333:                                     ; preds = %.lr.ph, %19, %8
  %.0262 = phi ptr [ null, %8 ], [ %20, %19 ], [ %20, %.lr.ph ]
  %.1261 = phi ptr [ null, %8 ], [ null, %19 ], [ %25, %.lr.ph ]
  %.1259 = phi i32 [ 0, %8 ], [ 0, %19 ], [ %22, %.lr.ph ]
  %29 = tail call i32 @feof(ptr noundef %0) #16
  %.not312462 = icmp eq i32 %29, 0
  br i1 %.not312462, label %.preheader332.lr.ph, label %._crit_edge479

.preheader332.lr.ph:                              ; preds = %.loopexit333
  %.not315 = icmp eq ptr %.1261, null
  %.not486 = icmp eq i32 %.1259, 0
  %.not318 = icmp eq i32 %5, 0
  %.not321 = icmp eq i32 %2, 0
  %30 = getelementptr inbounds i8, ptr %14, i64 4
  %.not322 = icmp eq i32 %3, 0
  %.not323 = icmp eq i32 %4, 0
  %wide.trip.count = zext i32 %.1259 to i64
  br label %.preheader332

.preheader332:                                    ; preds = %.preheader332.lr.ph, %.loopexit
  %.0248478 = phi ptr [ null, %.preheader332.lr.ph ], [ %.2, %.loopexit ]
  %.0253477 = phi i64 [ 0, %.preheader332.lr.ph ], [ %.2255, %.loopexit ]
  %.0263476 = phi ptr [ null, %.preheader332.lr.ph ], [ %.2265564, %.loopexit ]
  %.0266475 = phi ptr [ null, %.preheader332.lr.ph ], [ %.2268, %.loopexit ]
  %.0269474 = phi ptr [ null, %.preheader332.lr.ph ], [ %.2271, %.loopexit ]
  %.0272473 = phi ptr [ null, %.preheader332.lr.ph ], [ %.2274, %.loopexit ]
  %.0275472 = phi i32 [ 0, %.preheader332.lr.ph ], [ %.2277, %.loopexit ]
  %.0278471 = phi i32 [ 0, %.preheader332.lr.ph ], [ %.2280, %.loopexit ]
  %.0281470 = phi i32 [ 0, %.preheader332.lr.ph ], [ %.2283563, %.loopexit ]
  %.0284469 = phi i32 [ 0, %.preheader332.lr.ph ], [ %.1285562, %.loopexit ]
  %.0286468 = phi i32 [ 0, %.preheader332.lr.ph ], [ %.1287561, %.loopexit ]
  %.0288467 = phi i32 [ undef, %.preheader332.lr.ph ], [ %.2290560, %.loopexit ]
  %.0291466 = phi i32 [ 0, %.preheader332.lr.ph ], [ %.1292559, %.loopexit ]
  %.0293465 = phi i32 [ 0, %.preheader332.lr.ph ], [ %.5558, %.loopexit ]
  %.0296464 = phi i32 [ -1, %.preheader332.lr.ph ], [ %.2298, %.loopexit ]
  %.0299463 = phi i32 [ 0, %.preheader332.lr.ph ], [ %60, %.loopexit ]
  br label %31

31:                                               ; preds = %.preheader332, %42
  %.1254 = phi i64 [ %.2255, %42 ], [ %.0253477, %.preheader332 ]
  %.0251 = phi i64 [ %41, %42 ], [ 0, %.preheader332 ]
  %.1 = phi ptr [ %.2, %42 ], [ %.0248478, %.preheader332 ]
  %32 = add i64 %.0251, 4096
  %33 = icmp ugt i64 %32, %.1254
  br i1 %33, label %34, label %37

34:                                               ; preds = %31
  %35 = add i64 %.1254, 4096
  %36 = call ptr @realloc(ptr noundef %.1, i64 noundef %35) #17
  br label %37

37:                                               ; preds = %34, %31
  %.2255 = phi i64 [ %35, %34 ], [ %.1254, %31 ]
  %.2 = phi ptr [ %36, %34 ], [ %.1, %31 ]
  %38 = getelementptr inbounds i8, ptr %.2, i64 %.0251
  %39 = call ptr @fgets(ptr noundef %38, i32 noundef 4096, ptr noundef %0)
  %40 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %38) #18
  %41 = add i64 %40, %.0251
  %.not313 = icmp eq i64 %40, 0
  br i1 %.not313, label %.critedge, label %42

42:                                               ; preds = %37
  %43 = add i64 %41, -1
  %44 = getelementptr inbounds i8, ptr %.2, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !13
  %.not314 = icmp eq i8 %45, 10
  br i1 %.not314, label %.critedge, label %31, !llvm.loop !14

.critedge:                                        ; preds = %37, %42
  %46 = icmp ugt i64 %41, 1
  br i1 %46, label %47, label %58

47:                                               ; preds = %.critedge
  %48 = add i64 %41, -2
  %49 = getelementptr inbounds i8, ptr %.2, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !13
  %51 = icmp eq i8 %50, 13
  br i1 %51, label %52, label %58

52:                                               ; preds = %47
  %53 = add i64 %41, -1
  %54 = getelementptr inbounds i8, ptr %.2, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !13
  %56 = icmp eq i8 %55, 10
  br i1 %56, label %57, label %58

57:                                               ; preds = %52
  store i8 10, ptr %49, align 1, !tbaa !13
  store i8 0, ptr %54, align 1, !tbaa !13
  br label %58

58:                                               ; preds = %57, %52, %47, %.critedge
  %.1252 = phi i64 [ %53, %57 ], [ %41, %52 ], [ %41, %47 ], [ %41, %.critedge ]
  %59 = load i8, ptr %.2, align 1, !tbaa !13
  %60 = add i32 %.0299463, 1
  switch i8 %59, label %271 [
    i8 116, label %.thread
    i8 118, label %66
    i8 101, label %97
    i8 35, label %244
    i8 10, label %274
    i8 13, label %274
  ]

.thread:                                          ; preds = %58
  %61 = load i32, ptr %18, align 8, !tbaa !15
  %62 = add i32 %61, 1
  store i32 %62, ptr %18, align 8, !tbaa !15
  %63 = call i32 @fgetc(ptr noundef %0)
  %sext557 = shl i32 %63, 24
  %64 = ashr exact i32 %sext557, 24
  %65 = call i32 @ungetc(i32 noundef %64, ptr noundef %0)
  br label %.loopexit

66:                                               ; preds = %58
  %or.cond = icmp ult i32 %.0296464, 2
  br i1 %or.cond, label %70, label %67

67:                                               ; preds = %66
  %68 = load ptr, ptr @stderr, align 8, !tbaa !9
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.28, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

70:                                               ; preds = %66
  %71 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.2, ptr noundef nonnull @.str.29, ptr noundef nonnull %10, ptr noundef nonnull %11) #16
  %72 = icmp slt i32 %71, 2
  br i1 %72, label %73, label %76

73:                                               ; preds = %70
  %74 = load ptr, ptr @stderr, align 8, !tbaa !9
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.30, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

76:                                               ; preds = %70
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = icmp ugt i32 %77, 65534
  br i1 %78, label %79, label %82

79:                                               ; preds = %76
  %80 = load ptr, ptr @stderr, align 8, !tbaa !9
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.31, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

82:                                               ; preds = %76
  %83 = add i32 %.0286468, 1
  %.not324 = icmp ult i32 %77, %.0288467
  br i1 %.not324, label %.thread565, label %84

84:                                               ; preds = %82
  %.not325 = icmp ugt i32 %.0281470, %77
  br i1 %.not325, label %.thread565, label %85

85:                                               ; preds = %84
  %86 = add nuw nsw i32 %77, 1000
  %87 = shl nuw nsw i32 %86, 2
  %88 = zext nneg i32 %87 to i64
  %89 = call ptr @realloc(ptr noundef %.0263476, i64 noundef %88) #17
  %.pre548 = load i32, ptr %10, align 4, !tbaa !5
  br label %.thread565

.thread565:                                       ; preds = %82, %85, %84
  %90 = phi i32 [ %.pre548, %85 ], [ %77, %84 ], [ %77, %82 ]
  %.1289 = phi i32 [ %77, %85 ], [ %77, %84 ], [ %.0288467, %82 ]
  %.1282 = phi i32 [ %86, %85 ], [ %.0281470, %84 ], [ %.0281470, %82 ]
  %.1264 = phi ptr [ %89, %85 ], [ %.0263476, %84 ], [ %.0263476, %82 ]
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = zext i32 %90 to i64
  %93 = getelementptr inbounds i32, ptr %.1264, i64 %92
  store i32 %91, ptr %93, align 4, !tbaa !5
  %spec.select = call i32 @llvm.smax.i32(i32 %91, i32 %.0291466)
  %94 = call i32 @fgetc(ptr noundef %0)
  %sext574 = shl i32 %94, 24
  %95 = ashr exact i32 %sext574, 24
  %96 = call i32 @ungetc(i32 noundef %95, ptr noundef %0)
  br label %switch.early.test

97:                                               ; preds = %58
  %98 = add i32 %.0296464, -1
  %or.cond3 = icmp ult i32 %98, 2
  br i1 %or.cond3, label %102, label %99

99:                                               ; preds = %97
  %100 = load ptr, ptr @stderr, align 8, !tbaa !9
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.32, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

102:                                              ; preds = %97
  %103 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.2, ptr noundef nonnull @.str.33, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %9) #16
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i8, ptr %.2, i64 %105
  %107 = icmp slt i32 %103, 3
  br i1 %107, label %108, label %111

108:                                              ; preds = %102
  %109 = load ptr, ptr @stderr, align 8, !tbaa !9
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef nonnull @.str.34, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

111:                                              ; preds = %102
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %.not319 = icmp ult i32 %112, %.0286468
  br i1 %.not319, label %118, label %113

113:                                              ; preds = %111
  %114 = load ptr, ptr @stderr, align 8, !tbaa !9
  %115 = load i32, ptr %18, align 8, !tbaa !15
  %116 = add i32 %115, -1
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef nonnull @.str.35, i32 noundef %112, i32 noundef %116, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

118:                                              ; preds = %111
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %.not320 = icmp ult i32 %119, %.0286468
  br i1 %.not320, label %125, label %120

120:                                              ; preds = %118
  %121 = load ptr, ptr @stderr, align 8, !tbaa !9
  %122 = load i32, ptr %18, align 8, !tbaa !15
  %123 = add i32 %122, -1
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef nonnull @.str.35, i32 noundef %119, i32 noundef %123, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

125:                                              ; preds = %118
  %126 = icmp eq i32 %112, %119
  br i1 %126, label %127, label %132

127:                                              ; preds = %125
  %128 = load ptr, ptr @stderr, align 8, !tbaa !9
  %129 = load i32, ptr %18, align 8, !tbaa !15
  %130 = add i32 %129, -1
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef nonnull @.str.36, i32 noundef %112, i32 noundef %130, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

132:                                              ; preds = %125
  br i1 %.not321, label %133, label %134

133:                                              ; preds = %132
  store i32 0, ptr %14, align 8, !tbaa !17
  br label %134

134:                                              ; preds = %133, %132
  store i32 0, ptr %30, align 4, !tbaa !19
  br i1 %.not322, label %148, label %135

135:                                              ; preds = %134
  %136 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %106, ptr noundef nonnull @.str.37, ptr noundef nonnull %30, ptr noundef nonnull %9) #16
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i8, ptr %106, i64 %138
  %140 = icmp slt i32 %136, 1
  br i1 %140, label %141, label %148

141:                                              ; preds = %135
  %142 = load ptr, ptr @stderr, align 8, !tbaa !9
  %143 = load i32, ptr %12, align 4, !tbaa !5
  %144 = load i32, ptr %13, align 4, !tbaa !5
  %145 = load i32, ptr %18, align 8, !tbaa !15
  %146 = add i32 %145, -1
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef nonnull @.str.38, i32 noundef %143, i32 noundef %144, i32 noundef %146, i32 noundef %60) #19
  br label %148

148:                                              ; preds = %135, %141, %134
  %.0245 = phi ptr [ %139, %141 ], [ %139, %135 ], [ %106, %134 ]
  store i32 0, ptr %15, align 4, !tbaa !5
  br i1 %.not323, label %159, label %149

149:                                              ; preds = %148
  %150 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %.0245, ptr noundef nonnull @.str.39, ptr noundef nonnull %15, ptr noundef nonnull %9) #16
  %151 = icmp slt i32 %150, 1
  br i1 %151, label %152, label %159

152:                                              ; preds = %149
  %153 = load ptr, ptr @stderr, align 8, !tbaa !9
  %154 = load i32, ptr %12, align 4, !tbaa !5
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = load i32, ptr %18, align 8, !tbaa !15
  %157 = add i32 %156, -1
  %158 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef nonnull @.str.40, i32 noundef %154, i32 noundef %155, i32 noundef %157, i32 noundef %60) #19
  br label %159

159:                                              ; preds = %149, %152, %148
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = zext i32 %160 to i64
  %162 = getelementptr inbounds i32, ptr %.0266475, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %.not487 = icmp eq i32 %163, 0
  br i1 %.not487, label %.thread583, label %.lr.ph450

.thread583:                                       ; preds = %237, %159
  %.lcssa448 = phi i64 [ %161, %159 ], [ %239, %237 ]
  %.lcssa344 = phi i32 [ 0, %159 ], [ %241, %237 ]
  %164 = getelementptr inbounds i32, ptr %.0266475, i64 %.lcssa448
  %165 = load i32, ptr %13, align 4, !tbaa !5
  %166 = trunc i32 %165 to i16
  %167 = getelementptr inbounds ptr, ptr %.0272473, i64 %.lcssa448
  %168 = load ptr, ptr %167, align 8, !tbaa !9
  %169 = zext i32 %.lcssa344 to i64
  %170 = getelementptr inbounds %struct.neighbor_t, ptr %168, i64 %169
  store i16 %166, ptr %170, align 4, !tbaa !20
  %171 = getelementptr inbounds %struct.neighbor_t, ptr %168, i64 %169, i32 1
  %172 = load i64, ptr %14, align 8
  store i64 %172, ptr %171, align 4
  %173 = load i32, ptr %15, align 4, !tbaa !5
  %174 = load ptr, ptr %167, align 8, !tbaa !9
  %175 = load i32, ptr %164, align 4, !tbaa !5
  %176 = zext i32 %175 to i64
  %177 = getelementptr inbounds %struct.neighbor_t, ptr %174, i64 %176, i32 2
  store i32 %173, ptr %177, align 4, !tbaa !23
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = trunc i32 %178 to i16
  %180 = load i32, ptr %13, align 4, !tbaa !5
  %181 = zext i32 %180 to i64
  %182 = getelementptr inbounds ptr, ptr %.0272473, i64 %181
  %183 = load ptr, ptr %182, align 8, !tbaa !9
  %184 = getelementptr inbounds i32, ptr %.0266475, i64 %181
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = zext i32 %185 to i64
  %187 = getelementptr inbounds %struct.neighbor_t, ptr %183, i64 %186
  store i16 %179, ptr %187, align 4, !tbaa !20
  %188 = getelementptr inbounds %struct.neighbor_t, ptr %183, i64 %186, i32 1
  %189 = load i64, ptr %14, align 8
  store i64 %189, ptr %188, align 4
  %190 = call i32 @invert_direction(i32 noundef %173)
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds ptr, ptr %.0272473, i64 %192
  %194 = load ptr, ptr %193, align 8, !tbaa !9
  %195 = getelementptr inbounds i32, ptr %.0266475, i64 %192
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds %struct.neighbor_t, ptr %194, i64 %197, i32 2
  store i32 %190, ptr %198, align 4, !tbaa !23
  %199 = load i32, ptr %12, align 4, !tbaa !5
  %200 = zext i32 %199 to i64
  %201 = getelementptr inbounds i32, ptr %.0266475, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = add i32 %202, 1
  store i32 %203, ptr %201, align 4, !tbaa !5
  %204 = load i32, ptr %13, align 4, !tbaa !5
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds i32, ptr %.0266475, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = add i32 %207, 1
  store i32 %208, ptr %206, align 4, !tbaa !5
  %209 = add i32 %.0284469, 1
  %210 = call i32 @fgetc(ptr noundef %0)
  %sext592 = shl i32 %210, 24
  %211 = ashr exact i32 %sext592, 24
  %212 = call i32 @ungetc(i32 noundef %211, ptr noundef %0)
  br label %switch.early.test327

.lr.ph450:                                        ; preds = %159, %237
  %213 = phi i32 [ %238, %237 ], [ %160, %159 ]
  %indvars.iv533 = phi i64 [ %indvars.iv.next534, %237 ], [ 0, %159 ]
  %214 = phi i64 [ %239, %237 ], [ %161, %159 ]
  %215 = getelementptr inbounds ptr, ptr %.0272473, i64 %214
  %216 = load ptr, ptr %215, align 8, !tbaa !9
  %217 = getelementptr inbounds %struct.neighbor_t, ptr %216, i64 %indvars.iv533
  %218 = load i16, ptr %217, align 4, !tbaa !20
  %219 = zext i16 %218 to i32
  %220 = load i32, ptr %13, align 4, !tbaa !5
  %221 = icmp eq i32 %220, %219
  br i1 %221, label %222, label %237

222:                                              ; preds = %.lr.ph450
  %223 = getelementptr inbounds i8, ptr %217, i64 4
  %224 = call i32 @edge_label_compare(ptr noundef nonnull %223, ptr noundef nonnull %14)
  %225 = icmp eq i32 %224, 0
  br i1 %225, label %226, label %._crit_edge546

._crit_edge546:                                   ; preds = %222
  %.pre = load i32, ptr %12, align 4, !tbaa !5
  br label %237

226:                                              ; preds = %222
  %227 = load i32, ptr %15, align 4, !tbaa !5
  %228 = getelementptr inbounds i8, ptr %217, i64 12
  %229 = load i32, ptr %228, align 4, !tbaa !23
  %230 = icmp eq i32 %227, %229
  %.pre547 = load i32, ptr %12, align 4, !tbaa !5
  br i1 %230, label %231, label %237

231:                                              ; preds = %226
  %232 = load ptr, ptr @stderr, align 8, !tbaa !9
  %233 = load i32, ptr %13, align 4, !tbaa !5
  %234 = load i32, ptr %18, align 8, !tbaa !15
  %235 = add i32 %234, -1
  %236 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %232, ptr noundef nonnull @.str.41, i32 noundef %.pre547, i32 noundef %233, i32 noundef %235, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

237:                                              ; preds = %._crit_edge546, %226, %.lr.ph450
  %238 = phi i32 [ %.pre, %._crit_edge546 ], [ %.pre547, %226 ], [ %213, %.lr.ph450 ]
  %indvars.iv.next534 = add nuw nsw i64 %indvars.iv533, 1
  %239 = zext i32 %238 to i64
  %240 = getelementptr inbounds i32, ptr %.0266475, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = zext i32 %241 to i64
  %243 = icmp ult i64 %indvars.iv.next534, %242
  br i1 %243, label %.lr.ph450, label %.thread583, !llvm.loop !24

244:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %16) #16
  br i1 %.not315, label %.loopexit331, label %245

245:                                              ; preds = %244
  %246 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.42) #18
  %247 = call i32 @strncmp(ptr noundef nonnull %.2, ptr noundef nonnull @.str.42, i64 noundef %246) #18
  %248 = icmp eq i32 %247, 0
  br i1 %248, label %249, label %.loopexit331

249:                                              ; preds = %245
  %250 = getelementptr inbounds i8, ptr %.2, i64 %246
  %251 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) %250, i64 noundef 4096) #16
  %252 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %16) #18
  %253 = add i64 %252, -1
  %254 = getelementptr inbounds [4096 x i8], ptr %16, i64 0, i64 %253
  store i8 0, ptr %254, align 1, !tbaa !13
  %255 = call ptr @strtok(ptr noundef nonnull %16, ptr noundef nonnull @.str.27) #16
  %.not316441 = icmp eq ptr %255, null
  br i1 %.not316441, label %.loopexit331, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %249
  br i1 %.not486, label %.preheader.preheader, label %.preheader.us

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %.not317.peel = icmp eq i32 %.0293465, 0
  br i1 %.not317.peel, label %256, label %.loopexit331

256:                                              ; preds = %.preheader.preheader
  %257 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.27) #16
  %.not316.peel = icmp eq ptr %257, null
  br i1 %.not316.peel, label %.loopexit331, label %.preheader.peel.next

.preheader.us:                                    ; preds = %.preheader.lr.ph, %259
  %.0250443.us = phi ptr [ %260, %259 ], [ %255, %.preheader.lr.ph ]
  %.1294442.us = phi i32 [ 0, %259 ], [ %.0293465, %.preheader.lr.ph ]
  br label %261

258:                                              ; preds = %261
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %261, !llvm.loop !25

259:                                              ; preds = %._crit_edge.us
  %260 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.27) #16
  %.not316.us = icmp eq ptr %260, null
  br i1 %.not316.us, label %.loopexit331, label %.preheader.us, !llvm.loop !26

261:                                              ; preds = %.preheader.us, %258
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %258 ]
  %262 = getelementptr inbounds ptr, ptr %.1261, i64 %indvars.iv
  %263 = load ptr, ptr %262, align 8, !tbaa !9
  %264 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %263, ptr noundef nonnull dereferenceable(1) %.0250443.us) #18
  %265 = icmp eq i32 %264, 0
  br i1 %265, label %.thread.split.us, label %258

._crit_edge.us:                                   ; preds = %258
  %.not317.us = icmp eq i32 %.1294442.us, 0
  br i1 %.not317.us, label %259, label %.loopexit331

.thread.split.us:                                 ; preds = %261
  %266 = load i32, ptr %17, align 4, !tbaa !27
  %267 = add i32 %266, 1
  store i32 %267, ptr %17, align 4, !tbaa !27
  br label %.loopexit331

.preheader.peel.next:                             ; preds = %256, %.preheader.peel.next
  %268 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.27) #16
  %.not316 = icmp eq ptr %268, null
  br i1 %.not316, label %.loopexit331, label %.preheader.peel.next, !llvm.loop !28

.loopexit331:                                     ; preds = %._crit_edge.us, %259, %.preheader.peel.next, %.preheader.preheader, %256, %249, %.thread.split.us, %245, %244
  %.4 = phi i32 [ %.0293465, %245 ], [ %.0293465, %244 ], [ 1, %.thread.split.us ], [ %.0293465, %249 ], [ 1, %.preheader.preheader ], [ 0, %256 ], [ 0, %.preheader.peel.next ], [ 1, %._crit_edge.us ], [ 0, %259 ]
  br i1 %.not318, label %270, label %269

269:                                              ; preds = %.loopexit331
  call void @write_header_entry(ptr noundef %7, ptr noundef nonnull %.2, i64 noundef %.1252)
  br label %270

270:                                              ; preds = %269, %.loopexit331
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %16) #16
  br label %274

271:                                              ; preds = %58
  %272 = load ptr, ptr @stderr, align 8, !tbaa !9
  %273 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %272, ptr noundef nonnull @.str.43, ptr noundef nonnull %.2, i32 noundef %60) #19
  call void @exit(i32 noundef 1) #20
  unreachable

274:                                              ; preds = %270, %58, %58
  %.5 = phi i32 [ %.0293465, %58 ], [ %.0293465, %58 ], [ %.4, %270 ]
  %275 = call i32 @fgetc(ptr noundef %0)
  %sext = shl i32 %275, 24
  %276 = ashr exact i32 %sext, 24
  %277 = call i32 @ungetc(i32 noundef %276, ptr noundef %0)
  switch i32 %.0296464, label %.loopexit [
    i32 1, label %switch.early.test
    i32 2, label %switch.early.test327
  ]

switch.early.test:                                ; preds = %.thread565, %274
  %sext582 = phi i32 [ %sext574, %.thread565 ], [ %sext, %274 ]
  %.2265581 = phi ptr [ %.1264, %.thread565 ], [ %.0263476, %274 ]
  %.2283580 = phi i32 [ %.1282, %.thread565 ], [ %.0281470, %274 ]
  %.1287578 = phi i32 [ %83, %.thread565 ], [ %.0286468, %274 ]
  %.2290577 = phi i32 [ %.1289, %.thread565 ], [ %.0288467, %274 ]
  %.1292576 = phi i32 [ %spec.select, %.thread565 ], [ %.0291466, %274 ]
  %.5575 = phi i32 [ %.0293465, %.thread565 ], [ %.5, %274 ]
  switch i32 %sext582, label %278 [
    i32 1979711488, label %.loopexit
    i32 587202560, label %.loopexit
  ]

278:                                              ; preds = %switch.early.test
  %279 = add i32 %.2290577, 1
  %.not326 = icmp eq i32 %279, %.1287578
  br i1 %.not326, label %285, label %280

280:                                              ; preds = %278
  %281 = load ptr, ptr @stderr, align 8, !tbaa !9
  %282 = load i32, ptr %18, align 8, !tbaa !15
  %283 = add i32 %282, -1
  %284 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %281, ptr noundef nonnull @.str.44, i32 noundef %283, i32 noundef %.1287578, i32 noundef %.2290577) #19
  call void @exit(i32 noundef 1) #20
  unreachable

285:                                              ; preds = %278
  %286 = mul i32 %.1287578, %.1287578
  %287 = icmp ugt i32 %286, %.0275472
  br i1 %287, label %288, label %292

288:                                              ; preds = %285
  %289 = zext i32 %286 to i64
  call void @free(ptr noundef %.0269474) #16
  %290 = shl nuw nsw i64 %289, 4
  %291 = call noalias ptr @malloc(i64 noundef %290) #21
  br label %292

292:                                              ; preds = %288, %285
  %.1276 = phi i32 [ %286, %288 ], [ %.0275472, %285 ]
  %.1270 = phi ptr [ %291, %288 ], [ %.0269474, %285 ]
  %293 = icmp ugt i32 %.2283580, %.0278471
  br i1 %293, label %294, label %300

294:                                              ; preds = %292
  call void @free(ptr noundef %.0272473) #16
  call void @free(ptr noundef %.0266475) #16
  %295 = zext nneg i32 %.2283580 to i64
  %296 = shl nuw nsw i64 %295, 3
  %297 = call noalias ptr @malloc(i64 noundef %296) #21
  %298 = shl nuw nsw i64 %295, 2
  %299 = call noalias ptr @malloc(i64 noundef %298) #21
  br label %300

300:                                              ; preds = %294, %292
  %.1279 = phi i32 [ %.2283580, %294 ], [ %.0278471, %292 ]
  %.1273 = phi ptr [ %297, %294 ], [ %.0272473, %292 ]
  %.1267 = phi ptr [ %299, %294 ], [ %.0266475, %292 ]
  %301 = zext i32 %.1287578 to i64
  %302 = shl nuw nsw i64 %301, 2
  call void @llvm.memset.p0.i64(ptr align 4 %.1267, i8 0, i64 %302, i1 false)
  %.not489 = icmp eq i32 %.1287578, 0
  br i1 %.not489, label %.loopexit, label %.lr.ph461.preheader

.lr.ph461.preheader:                              ; preds = %300
  %min.iters.check = icmp ult i32 %.1287578, 4
  br i1 %min.iters.check, label %.lr.ph461.preheader677, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph461.preheader
  %n.vec = and i64 %301, 4294967292
  %ind.end = mul nuw i64 %n.vec, %301
  %.splatinsert = insertelement <2 x i64> poison, i64 %301, i64 0
  %.splat = shufflevector <2 x i64> %.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %303 = mul nuw nsw <2 x i64> %.splat, <i64 0, i64 1>
  %304 = shl nuw nsw i64 %301, 1
  %.splatinsert674 = insertelement <2 x i64> poison, i64 %304, i64 0
  %.splat675 = shufflevector <2 x i64> %.splatinsert674, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ %303, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, %.splat675
  %305 = getelementptr inbounds %struct.neighbor_t, ptr %.1270, <2 x i64> %vec.ind
  %306 = getelementptr inbounds %struct.neighbor_t, ptr %.1270, <2 x i64> %step.add
  %307 = getelementptr inbounds ptr, ptr %.1273, i64 %index
  %308 = getelementptr inbounds i8, ptr %307, i64 16
  store <2 x ptr> %305, ptr %307, align 8, !tbaa !9
  store <2 x ptr> %306, ptr %308, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %step.add, %.splat675
  %309 = icmp eq i64 %index.next, %n.vec
  br i1 %309, label %middle.block, label %vector.body, !llvm.loop !30

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %301
  br i1 %cmp.n, label %.loopexit, label %.lr.ph461.preheader677

.lr.ph461.preheader677:                           ; preds = %middle.block, %.lr.ph461.preheader
  %indvars.iv541.ph = phi i64 [ 0, %.lr.ph461.preheader ], [ %n.vec, %middle.block ]
  %.0247458.ph = phi i64 [ 0, %.lr.ph461.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph461

.lr.ph461:                                        ; preds = %.lr.ph461.preheader677, %.lr.ph461
  %indvars.iv541 = phi i64 [ %indvars.iv.next542, %.lr.ph461 ], [ %indvars.iv541.ph, %.lr.ph461.preheader677 ]
  %.0247458 = phi i64 [ %312, %.lr.ph461 ], [ %.0247458.ph, %.lr.ph461.preheader677 ]
  %310 = getelementptr inbounds %struct.neighbor_t, ptr %.1270, i64 %.0247458
  %311 = getelementptr inbounds ptr, ptr %.1273, i64 %indvars.iv541
  store ptr %310, ptr %311, align 8, !tbaa !9
  %312 = add nuw i64 %.0247458, %301
  %indvars.iv.next542 = add nuw nsw i64 %indvars.iv541, 1
  %exitcond545.not = icmp eq i64 %indvars.iv.next542, %301
  br i1 %exitcond545.not, label %.loopexit, label %.lr.ph461, !llvm.loop !33

switch.early.test327:                             ; preds = %.thread583, %274
  %sext600 = phi i32 [ %sext592, %.thread583 ], [ %sext, %274 ]
  %.1285597 = phi i32 [ %209, %.thread583 ], [ %.0284469, %274 ]
  %.5593 = phi i32 [ %.0293465, %.thread583 ], [ %.5, %274 ]
  switch i32 %sext600, label %313 [
    i32 1694498816, label %.loopexit
    i32 587202560, label %.loopexit
  ]

313:                                              ; preds = %switch.early.test327
  %314 = load ptr, ptr %1, align 8, !tbaa !34
  %315 = load i32, ptr %18, align 8, !tbaa !15
  %316 = zext i32 %315 to i64
  %317 = mul nuw nsw i64 %316, 40
  %318 = call ptr @realloc(ptr noundef %314, i64 noundef %317) #17
  store ptr %318, ptr %1, align 8, !tbaa !34
  %319 = load i32, ptr %18, align 8, !tbaa !15
  %320 = zext i32 %319 to i64
  %321 = getelementptr inbounds %struct.database_entry_t, ptr %318, i64 %320
  %322 = getelementptr inbounds i8, ptr %321, i64 -40
  %323 = add i32 %319, -1
  %324 = getelementptr inbounds i8, ptr %321, i64 -16
  store i32 %323, ptr %324, align 8, !tbaa !35
  %325 = getelementptr inbounds i8, ptr %321, i64 -12
  store i32 %.5593, ptr %325, align 4, !tbaa !37
  %326 = getelementptr inbounds i8, ptr %321, i64 -8
  store i32 %.0286468, ptr %326, align 8, !tbaa !38
  %327 = getelementptr inbounds i8, ptr %321, i64 -4
  store i32 %.1285597, ptr %327, align 4, !tbaa !39
  %328 = zext i32 %.0286468 to i64
  %329 = shl nuw nsw i64 %328, 2
  %330 = call noalias ptr @malloc(i64 noundef %329) #21
  store ptr %330, ptr %322, align 8, !tbaa !40
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %330, ptr align 4 %.0263476, i64 %329, i1 false)
  %331 = call noalias ptr @malloc(i64 noundef %329) #21
  %332 = getelementptr inbounds i8, ptr %321, i64 -32
  store ptr %331, ptr %332, align 8, !tbaa !41
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %331, ptr align 4 %.0266475, i64 %329, i1 false)
  %333 = shl nuw nsw i64 %328, 3
  %334 = call noalias ptr @malloc(i64 noundef %333) #21
  %335 = getelementptr inbounds i8, ptr %321, i64 -24
  store ptr %334, ptr %335, align 8, !tbaa !42
  %336 = shl i32 %.1285597, 1
  %337 = zext i32 %336 to i64
  %338 = shl nuw nsw i64 %337, 4
  %339 = call noalias ptr @malloc(i64 noundef %338) #21
  %.not488 = icmp eq i32 %.0286468, 0
  br i1 %.not488, label %.loopexit, label %.lr.ph457

.lr.ph457:                                        ; preds = %313, %.lr.ph457
  %indvars.iv536 = phi i64 [ %indvars.iv.next537, %.lr.ph457 ], [ 0, %313 ]
  %.0244454 = phi i32 [ %351, %.lr.ph457 ], [ 0, %313 ]
  %340 = zext i32 %.0244454 to i64
  %341 = getelementptr inbounds %struct.neighbor_t, ptr %339, i64 %340
  %342 = load ptr, ptr %335, align 8, !tbaa !42
  %343 = getelementptr inbounds ptr, ptr %342, i64 %indvars.iv536
  store ptr %341, ptr %343, align 8, !tbaa !9
  %344 = getelementptr inbounds ptr, ptr %.0272473, i64 %indvars.iv536
  %345 = load ptr, ptr %344, align 8, !tbaa !9
  %346 = getelementptr inbounds i32, ptr %.0266475, i64 %indvars.iv536
  %347 = load i32, ptr %346, align 4, !tbaa !5
  %348 = zext i32 %347 to i64
  %349 = shl nuw nsw i64 %348, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %341, ptr align 4 %345, i64 %349, i1 false)
  %350 = load i32, ptr %346, align 4, !tbaa !5
  %351 = add i32 %350, %.0244454
  %indvars.iv.next537 = add nuw nsw i64 %indvars.iv536, 1
  %exitcond540.not = icmp eq i64 %indvars.iv.next537, %328
  br i1 %exitcond540.not, label %.loopexit, label %.lr.ph457, !llvm.loop !43

.loopexit:                                        ; preds = %.lr.ph457, %.lr.ph461, %middle.block, %.thread, %313, %300, %switch.early.test, %switch.early.test, %274, %switch.early.test327, %switch.early.test327
  %.2265564 = phi ptr [ %.0263476, %switch.early.test327 ], [ %.0263476, %switch.early.test327 ], [ %.0263476, %274 ], [ %.2265581, %switch.early.test ], [ %.2265581, %switch.early.test ], [ %.2265581, %300 ], [ %.0263476, %313 ], [ %.0263476, %.thread ], [ %.2265581, %middle.block ], [ %.2265581, %.lr.ph461 ], [ %.0263476, %.lr.ph457 ]
  %.2283563 = phi i32 [ %.0281470, %switch.early.test327 ], [ %.0281470, %switch.early.test327 ], [ %.0281470, %274 ], [ %.2283580, %switch.early.test ], [ %.2283580, %switch.early.test ], [ %.2283580, %300 ], [ %.0281470, %313 ], [ %.0281470, %.thread ], [ %.2283580, %middle.block ], [ %.2283580, %.lr.ph461 ], [ %.0281470, %.lr.ph457 ]
  %.1285562 = phi i32 [ %.1285597, %switch.early.test327 ], [ %.1285597, %switch.early.test327 ], [ %.0284469, %274 ], [ %.0284469, %switch.early.test ], [ %.0284469, %switch.early.test ], [ %.0284469, %300 ], [ %.1285597, %313 ], [ 0, %.thread ], [ %.0284469, %middle.block ], [ %.0284469, %.lr.ph461 ], [ %.1285597, %.lr.ph457 ]
  %.1287561 = phi i32 [ %.0286468, %switch.early.test327 ], [ %.0286468, %switch.early.test327 ], [ %.0286468, %274 ], [ %.1287578, %switch.early.test ], [ %.1287578, %switch.early.test ], [ 0, %300 ], [ 0, %313 ], [ 0, %.thread ], [ %.1287578, %middle.block ], [ %.1287578, %.lr.ph461 ], [ %.0286468, %.lr.ph457 ]
  %.2290560 = phi i32 [ %.0288467, %switch.early.test327 ], [ %.0288467, %switch.early.test327 ], [ %.0288467, %274 ], [ %.2290577, %switch.early.test ], [ %.2290577, %switch.early.test ], [ %.2290577, %300 ], [ %.0288467, %313 ], [ 0, %.thread ], [ %.2290577, %middle.block ], [ %.2290577, %.lr.ph461 ], [ %.0288467, %.lr.ph457 ]
  %.1292559 = phi i32 [ %.0291466, %switch.early.test327 ], [ %.0291466, %switch.early.test327 ], [ %.0291466, %274 ], [ %.1292576, %switch.early.test ], [ %.1292576, %switch.early.test ], [ %.1292576, %300 ], [ %.0291466, %313 ], [ %.0291466, %.thread ], [ %.1292576, %middle.block ], [ %.1292576, %.lr.ph461 ], [ %.0291466, %.lr.ph457 ]
  %.5558 = phi i32 [ %.5593, %switch.early.test327 ], [ %.5593, %switch.early.test327 ], [ %.5, %274 ], [ %.5575, %switch.early.test ], [ %.5575, %switch.early.test ], [ %.5575, %300 ], [ %.5593, %313 ], [ 0, %.thread ], [ %.5575, %middle.block ], [ %.5575, %.lr.ph461 ], [ %.5593, %.lr.ph457 ]
  %.2298 = phi i32 [ 2, %switch.early.test327 ], [ 2, %switch.early.test327 ], [ %.0296464, %274 ], [ 1, %switch.early.test ], [ 1, %switch.early.test ], [ 2, %300 ], [ 0, %313 ], [ 0, %.thread ], [ 2, %middle.block ], [ 2, %.lr.ph461 ], [ 0, %.lr.ph457 ]
  %.2280 = phi i32 [ %.0278471, %switch.early.test327 ], [ %.0278471, %switch.early.test327 ], [ %.0278471, %274 ], [ %.0278471, %switch.early.test ], [ %.0278471, %switch.early.test ], [ %.1279, %300 ], [ %.0278471, %313 ], [ %.0278471, %.thread ], [ %.1279, %middle.block ], [ %.1279, %.lr.ph461 ], [ %.0278471, %.lr.ph457 ]
  %.2277 = phi i32 [ %.0275472, %switch.early.test327 ], [ %.0275472, %switch.early.test327 ], [ %.0275472, %274 ], [ %.0275472, %switch.early.test ], [ %.0275472, %switch.early.test ], [ %.1276, %300 ], [ %.0275472, %313 ], [ %.0275472, %.thread ], [ %.1276, %middle.block ], [ %.1276, %.lr.ph461 ], [ %.0275472, %.lr.ph457 ]
  %.2274 = phi ptr [ %.0272473, %switch.early.test327 ], [ %.0272473, %switch.early.test327 ], [ %.0272473, %274 ], [ %.0272473, %switch.early.test ], [ %.0272473, %switch.early.test ], [ %.1273, %300 ], [ %.0272473, %313 ], [ %.0272473, %.thread ], [ %.1273, %middle.block ], [ %.1273, %.lr.ph461 ], [ %.0272473, %.lr.ph457 ]
  %.2271 = phi ptr [ %.0269474, %switch.early.test327 ], [ %.0269474, %switch.early.test327 ], [ %.0269474, %274 ], [ %.0269474, %switch.early.test ], [ %.0269474, %switch.early.test ], [ %.1270, %300 ], [ %.0269474, %313 ], [ %.0269474, %.thread ], [ %.1270, %middle.block ], [ %.1270, %.lr.ph461 ], [ %.0269474, %.lr.ph457 ]
  %.2268 = phi ptr [ %.0266475, %switch.early.test327 ], [ %.0266475, %switch.early.test327 ], [ %.0266475, %274 ], [ %.0266475, %switch.early.test ], [ %.0266475, %switch.early.test ], [ %.1267, %300 ], [ %.0266475, %313 ], [ %.0266475, %.thread ], [ %.1267, %middle.block ], [ %.1267, %.lr.ph461 ], [ %.0266475, %.lr.ph457 ]
  %352 = call i32 @feof(ptr noundef %0) #16
  %.not312 = icmp eq i32 %352, 0
  br i1 %.not312, label %.preheader332, label %._crit_edge479.loopexit, !llvm.loop !44

._crit_edge479.loopexit:                          ; preds = %.loopexit
  %353 = add nuw nsw i32 %.1292559, 1
  br label %._crit_edge479

._crit_edge479:                                   ; preds = %._crit_edge479.loopexit, %.loopexit333
  %.0291.lcssa = phi i32 [ 1, %.loopexit333 ], [ %353, %._crit_edge479.loopexit ]
  %.0272.lcssa = phi ptr [ null, %.loopexit333 ], [ %.2274, %._crit_edge479.loopexit ]
  %.0269.lcssa = phi ptr [ null, %.loopexit333 ], [ %.2271, %._crit_edge479.loopexit ]
  %.0266.lcssa = phi ptr [ null, %.loopexit333 ], [ %.2268, %._crit_edge479.loopexit ]
  %.0263.lcssa = phi ptr [ null, %.loopexit333 ], [ %.2265564, %._crit_edge479.loopexit ]
  %.0248.lcssa = phi ptr [ null, %.loopexit333 ], [ %.2, %._crit_edge479.loopexit ]
  call void @free(ptr noundef %.0263.lcssa) #16
  call void @free(ptr noundef %.0272.lcssa) #16
  call void @free(ptr noundef %.0266.lcssa) #16
  call void @free(ptr noundef %.0269.lcssa) #16
  call void @free(ptr noundef %.1261) #16
  call void @free(ptr noundef %.0262) #16
  call void @free(ptr noundef %.0248.lcssa) #16
  %354 = load ptr, ptr %1, align 8, !tbaa !34
  %355 = load i32, ptr %18, align 8, !tbaa !15
  %356 = zext i32 %355 to i64
  call void @qsort(ptr noundef %354, i64 noundef %356, i64 noundef 40, ptr noundef nonnull @database_entry_vertex_size_compare) #16
  %357 = getelementptr inbounds i8, ptr %1, i64 16
  store i32 %.0291.lcssa, ptr %357, align 8, !tbaa !45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #16
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #10

; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #11

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #12

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #12

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #13

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #12

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #14

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 #6 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { inlinehint 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 #9 = { 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 #10 = { mustprogress nofree nounwind willreturn 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 #11 = { 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 #12 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #13 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 #14 = { nofree "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 #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #16 = { nounwind }
attributes #17 = { nounwind allocsize(1) }
attributes #18 = { nounwind willreturn memory(read) }
attributes #19 = { cold nounwind }
attributes #20 = { noreturn nounwind }
attributes #21 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = !{!16, !6, i64 8}
!16 = !{!"database_t", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}
!17 = !{!18, !6, i64 0}
!18 = !{!"edge_label_t", !6, i64 0, !6, i64 4}
!19 = !{!18, !6, i64 4}
!20 = !{!21, !22, i64 0}
!21 = !{!"neighbor_t", !22, i64 0, !18, i64 4, !6, i64 12}
!22 = !{!"short", !7, i64 0}
!23 = !{!21, !6, i64 12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = !{!16, !6, i64 12}
!28 = distinct !{!28, !12, !29}
!29 = !{!"llvm.loop.peeled.count", i32 1}
!30 = distinct !{!30, !12, !31, !32}
!31 = !{!"llvm.loop.isvectorized", i32 1}
!32 = !{!"llvm.loop.unroll.runtime.disable"}
!33 = distinct !{!33, !12, !32, !31}
!34 = !{!16, !10, i64 0}
!35 = !{!36, !6, i64 24}
!36 = !{!"database_entry_t", !10, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36}
!37 = !{!36, !6, i64 28}
!38 = !{!36, !6, i64 32}
!39 = !{!36, !6, i64 36}
!40 = !{!36, !10, i64 0}
!41 = !{!36, !10, i64 8}
!42 = !{!36, !10, i64 16}
!43 = distinct !{!43, !12}
!44 = distinct !{!44, !12}
!45 = !{!16, !6, i64 16}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass