; LLVM IR from fcimeson/cbTSP :: cbLKH/SRC (ReadProblem)

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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@Delimiters = external hidden constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [5 x i8], align 1
@Optimum = external dso_local global i64, align 8
@.str.35 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [35 x i8], align 1
@DimensionSaved = external dso_local global i32, align 4
@.str.38 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [40 x i8], align 1

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

declare void @eprintf(ptr noundef, ...) #1

declare ptr @ReadLine(ptr noundef) #1

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() #4

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

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

; Function Attrs: nounwind uwtable
declare hidden void @Read_TOUR_SECTION(ptr noundef) #5

declare i32 @fclose(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @ReadTour(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = call noalias ptr @fopen(ptr noundef %13, ptr noundef @.str)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %14, ptr %15, align 8, !tbaa !5
  %16 = icmp ne ptr %14, null
  br i1 %16, label %19, label %17

17:                                               ; preds = %2
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ...) @eprintf(ptr noundef @.str.32, ptr noundef %18)
  br label %19

19:                                               ; preds = %17, %2
  br label %20

20:                                               ; preds = %172, %29, %19
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = call ptr @ReadLine(ptr noundef %22)
  store ptr %23, ptr %5, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %173

25:                                               ; preds = %20
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call ptr @strtok(ptr noundef %26, ptr noundef @Delimiters) #6
  store ptr %27, ptr %6, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  br label %20, !llvm.loop !11

30:                                               ; preds = %25
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %56, %30
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call i64 @strlen(ptr noundef %34) #7
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %37, label %59

37:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %38 = call ptr @__ctype_toupper_loc() #8
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %40, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !13
  %45 = sext i8 %44 to i32
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %39, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  store i32 %48, ptr %10, align 4, !tbaa !9
  %49 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %49, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = trunc i32 %50 to i8
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  store i8 %51, ptr %55, align 1, !tbaa !13
  br label %56

56:                                               ; preds = %37
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = add i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !9
  br label %31, !llvm.loop !14

59:                                               ; preds = %31
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = call i32 @strcmp(ptr noundef %60, ptr noundef @.str.4) #7
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %119

63:                                               ; preds = %59
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = call i32 @strcmp(ptr noundef %64, ptr noundef @.str.5) #7
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %119

67:                                               ; preds = %63
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = call i32 @strcmp(ptr noundef %68, ptr noundef @.str.7) #7
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %119

71:                                               ; preds = %67
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = call i32 @strcmp(ptr noundef %72, ptr noundef @.str.9) #7
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %119

75:                                               ; preds = %71
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = call i32 @strcmp(ptr noundef %76, ptr noundef @.str.10) #7
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %119

79:                                               ; preds = %75
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call i32 @strcmp(ptr noundef %80, ptr noundef @.str.11) #7
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %119

83:                                               ; preds = %79
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = call i32 @strcmp(ptr noundef %84, ptr noundef @.str.12) #7
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %119

87:                                               ; preds = %83
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = call i32 @strcmp(ptr noundef %88, ptr noundef @.str.13) #7
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %119

91:                                               ; preds = %87
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = call i32 @strcmp(ptr noundef %92, ptr noundef @.str.14) #7
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %119

95:                                               ; preds = %91
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = call i32 @strcmp(ptr noundef %96, ptr noundef @.str.15) #7
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %119

99:                                               ; preds = %95
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = call i32 @strcmp(ptr noundef %100, ptr noundef @.str.17) #7
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %119

103:                                              ; preds = %99
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = call i32 @strcmp(ptr noundef %104, ptr noundef @.str.18) #7
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %119

107:                                              ; preds = %103
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = call i32 @strcmp(ptr noundef %108, ptr noundef @.str.19) #7
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %119

111:                                              ; preds = %107
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = call i32 @strcmp(ptr noundef %112, ptr noundef @.str.20) #7
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %119

115:                                              ; preds = %111
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = call i32 @strcmp(ptr noundef %116, ptr noundef @.str.22) #7
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %120, label %119

119:                                              ; preds = %115, %111, %107, %103, %99, %95, %91, %87, %83, %79, %75, %71, %67, %63, %59
  br label %172

120:                                              ; preds = %115
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = call i32 @strcmp(ptr noundef %121, ptr noundef @.str.33) #7
  %123 = icmp eq i32 %122, 0
  br i1 %123, label %124, label %134

124:                                              ; preds = %120
  %125 = call ptr @strtok(ptr noundef null, ptr noundef @Delimiters) #6
  store ptr %125, ptr %7, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %127, label %131

127:                                              ; preds = %124
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %128, ptr noundef @.str.34, ptr noundef @Optimum) #6
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %133, label %131

131:                                              ; preds = %127, %124
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ...) @eprintf(ptr noundef @.str.35, ptr noundef %132)
  br label %133

133:                                              ; preds = %131, %127
  br label %171

134:                                              ; preds = %120
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = call i32 @strcmp(ptr noundef %135, ptr noundef @.str.8) #7
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %154

138:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  %139 = call ptr @strtok(ptr noundef null, ptr noundef @Delimiters) #6
  store ptr %139, ptr %7, align 8, !tbaa !5
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %145

141:                                              ; preds = %138
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %142, ptr noundef @.str.36, ptr noundef %12) #6
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %147, label %145

145:                                              ; preds = %141, %138
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ...) @eprintf(ptr noundef @.str.37, ptr noundef %146)
  br label %147

147:                                              ; preds = %145, %141
  %148 = load i32, ptr %12, align 4, !tbaa !9
  %149 = load i32, ptr @DimensionSaved, align 4, !tbaa !9
  %150 = icmp ne i32 %148, %149
  br i1 %150, label %151, label %153

151:                                              ; preds = %147
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ...) @eprintf(ptr noundef @.str.38, ptr noundef %152)
  br label %153

153:                                              ; preds = %151, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %170

154:                                              ; preds = %134
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = call i32 @strcmp(ptr noundef %155, ptr noundef @.str.21) #7
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %160, label %158

158:                                              ; preds = %154
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  call void @Read_TOUR_SECTION(ptr noundef %159)
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %169

160:                                              ; preds = %154
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = call i32 @strcmp(ptr noundef %161, ptr noundef @.str.16) #7
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  br label %173

165:                                              ; preds = %160
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, ...) @eprintf(ptr noundef @.str.39, ptr noundef %166, ptr noundef %167)
  br label %168

168:                                              ; preds = %165
  br label %169

169:                                              ; preds = %168, %158
  br label %170

170:                                              ; preds = %169, %153
  br label %171

171:                                              ; preds = %170, %133
  br label %172

172:                                              ; preds = %171, %119
  br label %20, !llvm.loop !11

173:                                              ; preds = %164, %20
  %174 = load i32, ptr %9, align 4, !tbaa !9
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %178, label %176

176:                                              ; preds = %173
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ...) @eprintf(ptr noundef @.str.40, ptr noundef %177)
  br label %178

178:                                              ; preds = %176, %173
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = load ptr, ptr %179, align 8, !tbaa !5
  %181 = call i32 @fclose(ptr noundef %180)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "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 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 #4 = { nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind willreturn memory(none) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@Delimiters = external hidden constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [5 x i8], align 1
@Optimum = external dso_local global i64, align 8
@.str.35 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [35 x i8], align 1
@DimensionSaved = external dso_local local_unnamed_addr global i32, align 4
@.str.38 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [40 x i8], align 1

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

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

declare ptr @ReadLine(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() local_unnamed_addr #5

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @ReadTour(ptr noundef %0, ptr noundef %1) local_unnamed_addr #6 {
  %3 = alloca i32, align 4
  %4 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  store ptr %4, ptr %1, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %.outer.preheader

5:                                                ; preds = %2
  tail call void (ptr, ...) @eprintf(ptr noundef nonnull @.str.32, ptr noundef %0) #7
  br label %.outer.preheader

.outer.preheader:                                 ; preds = %5, %2
  br label %.outer

.outer:                                           ; preds = %.outer.backedge, %.outer.preheader
  %.043.ph = phi i32 [ 0, %.outer.preheader ], [ %.043.ph.be, %.outer.backedge ]
  br label %6

6:                                                ; preds = %.outer, %9
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = call ptr @ReadLine(ptr noundef %7) #7
  %.not49 = icmp eq ptr %8, null
  br i1 %.not49, label %.loopexit, label %9

9:                                                ; preds = %6
  %10 = call ptr @strtok(ptr noundef nonnull %8, ptr noundef nonnull @Delimiters) #7
  %.not50 = icmp eq ptr %10, null
  br i1 %.not50, label %6, label %.preheader, !llvm.loop !9

.preheader:                                       ; preds = %9
  %char0 = load i8, ptr %10, align 1
  %.not78 = icmp eq i8 %char0, 0
  br i1 %.not78, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %11 = tail call ptr @__ctype_toupper_loc() #8
  br label %12

12:                                               ; preds = %.lr.ph, %12
  %13 = phi i64 [ 0, %.lr.ph ], [ %22, %12 ]
  %.077 = phi i32 [ 0, %.lr.ph ], [ %21, %12 ]
  %14 = load ptr, ptr %11, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %10, i64 %13
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = sext i8 %16 to i64
  %18 = getelementptr inbounds i32, ptr %14, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !12
  %20 = trunc i32 %19 to i8
  store i8 %20, ptr %15, align 1, !tbaa !11
  %21 = add i32 %.077, 1
  %22 = zext i32 %21 to i64
  %23 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %10) #9
  %24 = icmp ugt i64 %23, %22
  br i1 %24, label %12, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %12, %.preheader
  %25 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.4) #9
  %.not51 = icmp eq i32 %25, 0
  br i1 %.not51, label %.outer.backedge, label %26

26:                                               ; preds = %._crit_edge
  %27 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.5) #9
  %.not52 = icmp eq i32 %27, 0
  br i1 %.not52, label %.outer.backedge, label %28

28:                                               ; preds = %26
  %29 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.7) #9
  %.not53 = icmp eq i32 %29, 0
  br i1 %.not53, label %.outer.backedge, label %30

30:                                               ; preds = %28
  %31 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.9) #9
  %.not54 = icmp eq i32 %31, 0
  br i1 %.not54, label %.outer.backedge, label %32

32:                                               ; preds = %30
  %33 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.10) #9
  %.not55 = icmp eq i32 %33, 0
  br i1 %.not55, label %.outer.backedge, label %34

34:                                               ; preds = %32
  %35 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.11) #9
  %.not56 = icmp eq i32 %35, 0
  br i1 %.not56, label %.outer.backedge, label %36

36:                                               ; preds = %34
  %37 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.12) #9
  %.not57 = icmp eq i32 %37, 0
  br i1 %.not57, label %.outer.backedge, label %38

38:                                               ; preds = %36
  %39 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.13) #9
  %.not58 = icmp eq i32 %39, 0
  br i1 %.not58, label %.outer.backedge, label %40

40:                                               ; preds = %38
  %41 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.14) #9
  %.not59 = icmp eq i32 %41, 0
  br i1 %.not59, label %.outer.backedge, label %42

42:                                               ; preds = %40
  %43 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.15) #9
  %.not60 = icmp eq i32 %43, 0
  br i1 %.not60, label %.outer.backedge, label %44

44:                                               ; preds = %42
  %45 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.17) #9
  %.not61 = icmp eq i32 %45, 0
  br i1 %.not61, label %.outer.backedge, label %46

46:                                               ; preds = %44
  %47 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.18) #9
  %.not62 = icmp eq i32 %47, 0
  br i1 %.not62, label %.outer.backedge, label %48

48:                                               ; preds = %46
  %49 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.19) #9
  %.not63 = icmp eq i32 %49, 0
  br i1 %.not63, label %.outer.backedge, label %50

50:                                               ; preds = %48
  %51 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.20) #9
  %.not64 = icmp eq i32 %51, 0
  br i1 %.not64, label %.outer.backedge, label %52

52:                                               ; preds = %50
  %53 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.22) #9
  %.not65 = icmp eq i32 %53, 0
  br i1 %.not65, label %.outer.backedge, label %54

54:                                               ; preds = %52
  %55 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.33) #9
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %62

57:                                               ; preds = %54
  %58 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @Delimiters) #7
  %.not72 = icmp eq ptr %58, null
  br i1 %.not72, label %61, label %59

59:                                               ; preds = %57
  %60 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %58, ptr noundef nonnull @.str.34, ptr noundef nonnull @Optimum) #7
  %.not73 = icmp eq i32 %60, 0
  br i1 %.not73, label %61, label %.outer.backedge

61:                                               ; preds = %59, %57
  call void (ptr, ...) @eprintf(ptr noundef nonnull @.str.35, ptr noundef %0) #7
  br label %.outer.backedge

.outer.backedge:                                  ; preds = %61, %59, %77, %80, %74, %._crit_edge, %26, %28, %30, %32, %34, %36, %38, %40, %42, %44, %46, %48, %50, %52
  %.043.ph.be = phi i32 [ %.043.ph, %59 ], [ %.043.ph, %61 ], [ %.043.ph, %74 ], [ %.043.ph, %80 ], [ 1, %77 ], [ %.043.ph, %52 ], [ %.043.ph, %50 ], [ %.043.ph, %48 ], [ %.043.ph, %46 ], [ %.043.ph, %44 ], [ %.043.ph, %42 ], [ %.043.ph, %40 ], [ %.043.ph, %38 ], [ %.043.ph, %36 ], [ %.043.ph, %34 ], [ %.043.ph, %32 ], [ %.043.ph, %30 ], [ %.043.ph, %28 ], [ %.043.ph, %26 ], [ %.043.ph, %._crit_edge ]
  br label %.outer, !llvm.loop !9

62:                                               ; preds = %54
  %63 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.8) #9
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %65, label %75

65:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !12
  %66 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @Delimiters) #7
  %.not69 = icmp eq ptr %66, null
  br i1 %.not69, label %69, label %67

67:                                               ; preds = %65
  %68 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %66, ptr noundef nonnull @.str.36, ptr noundef nonnull %3) #7
  %.not70 = icmp eq i32 %68, 0
  br i1 %.not70, label %69, label %70

69:                                               ; preds = %67, %65
  call void (ptr, ...) @eprintf(ptr noundef nonnull @.str.37, ptr noundef %0) #7
  br label %70

70:                                               ; preds = %69, %67
  %71 = load i32, ptr %3, align 4, !tbaa !12
  %72 = load i32, ptr @DimensionSaved, align 4, !tbaa !12
  %.not71 = icmp eq i32 %71, %72
  br i1 %.not71, label %74, label %73

73:                                               ; preds = %70
  call void (ptr, ...) @eprintf(ptr noundef nonnull @.str.38, ptr noundef %0) #7
  br label %74

74:                                               ; preds = %73, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %.outer.backedge

75:                                               ; preds = %62
  %76 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.21) #9
  %.not66 = icmp eq i32 %76, 0
  br i1 %.not66, label %77, label %78

77:                                               ; preds = %75
  call void @Read_TOUR_SECTION(ptr noundef nonnull %1)
  br label %.outer.backedge

78:                                               ; preds = %75
  %79 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %10, ptr noundef nonnull dereferenceable(1) @.str.16) #9
  %.not67 = icmp eq i32 %79, 0
  br i1 %.not67, label %.loopexit, label %80

80:                                               ; preds = %78
  call void (ptr, ...) @eprintf(ptr noundef nonnull @.str.39, ptr noundef %0, ptr noundef nonnull %10) #7
  br label %.outer.backedge

.loopexit:                                        ; preds = %78, %6
  %.not68 = icmp eq i32 %.043.ph, 0
  br i1 %.not68, label %81, label %82

81:                                               ; preds = %.loopexit
  call void (ptr, ...) @eprintf(ptr noundef nonnull @.str.40, ptr noundef %0) #7
  br label %82

82:                                               ; preds = %81, %.loopexit
  %83 = load ptr, ptr %1, align 8, !tbaa !5
  %84 = call i32 @fclose(ptr noundef %83)
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { 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 #5 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(read) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !10}


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