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

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

@TraceLevel = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@TourFileName = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@OutputTourFileName = external dso_local global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__.WriteTour = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@Name = external dso_local global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@ProblemType = external dso_local global i32, align 4
@Dimension = external dso_local global i32, align 4
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @WriteTour(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, 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 ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  store i32 1, ptr %14, align 4
  br label %165

18:                                               ; preds = %3
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = load i64, ptr %6, align 8, !tbaa !9
  %21 = call ptr @FullName(ptr noundef %19, i64 noundef %20)
  store ptr %21, ptr %12, align 8, !tbaa !5
  %22 = call i64 @time(ptr noundef %13) #5
  store i64 %22, ptr %13, align 8, !tbaa !11
  %23 = load i32, ptr @TraceLevel, align 4, !tbaa !13
  %24 = icmp sge i32 %23, 1
  br i1 %24, label %25, label %39

25:                                               ; preds = %18
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr @TourFileName, align 8, !tbaa !5
  %28 = icmp eq ptr %26, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  br label %36

30:                                               ; preds = %25
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = load ptr, ptr @OutputTourFileName, align 8, !tbaa !5
  %33 = icmp eq ptr %31, %32
  %34 = zext i1 %33 to i64
  %35 = select i1 %33, ptr @.str.2, ptr @.str.3
  br label %36

36:                                               ; preds = %30, %29
  %37 = phi ptr [ @.str.1, %29 ], [ %35, %30 ]
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  call void (ptr, ...) @printff(ptr noundef @.str, ptr noundef %37, ptr noundef %38)
  br label %39

39:                                               ; preds = %36, %18
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = call noalias ptr @fopen(ptr noundef %40, ptr noundef @.str.4)
  store ptr %41, ptr %7, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  br label %45

44:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 32, ptr noundef @__PRETTY_FUNCTION__.WriteTour) #6
  unreachable

45:                                               ; preds = %43
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr @Name, align 8, !tbaa !5
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.7, ptr noundef %47, i64 noundef %48) #5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load i64, ptr %6, align 8, !tbaa !9
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.8, i64 noundef %51) #5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = call ptr @ctime(ptr noundef %13) #5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.9, ptr noundef %54) #5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.10) #5
  %58 = load i32, ptr @ProblemType, align 4, !tbaa !13
  %59 = icmp ne i32 %58, 1
  br i1 %59, label %60, label %62

60:                                               ; preds = %45
  %61 = load i32, ptr @Dimension, align 4, !tbaa !13
  br label %65

62:                                               ; preds = %45
  %63 = load i32, ptr @Dimension, align 4, !tbaa !13
  %64 = sdiv i32 %63, 2
  br label %65

65:                                               ; preds = %62, %60
  %66 = phi i32 [ %61, %60 ], [ %64, %62 ]
  store i32 %66, ptr %10, align 4, !tbaa !13
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !13
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.11, i32 noundef %68) #5
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.12) #5
  store i32 1, ptr %8, align 4, !tbaa !13
  br label %72

72:                                               ; preds = %86, %65
  %73 = load i32, ptr %8, align 4, !tbaa !13
  %74 = load i32, ptr %10, align 4, !tbaa !13
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %76, label %83

76:                                               ; preds = %72
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load i32, ptr %8, align 4, !tbaa !13
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i32, ptr %77, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !13
  %82 = icmp ne i32 %81, 1
  br label %83

83:                                               ; preds = %76, %72
  %84 = phi i1 [ false, %72 ], [ %82, %76 ]
  br i1 %84, label %85, label %89

85:                                               ; preds = %83
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %8, align 4, !tbaa !13
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %8, align 4, !tbaa !13
  br label %72, !llvm.loop !15

89:                                               ; preds = %83
  %90 = load i32, ptr @ProblemType, align 4, !tbaa !13
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %120, label %92

92:                                               ; preds = %89
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load i32, ptr %8, align 4, !tbaa !13
  %95 = load i32, ptr %10, align 4, !tbaa !13
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %100

97:                                               ; preds = %92
  %98 = load i32, ptr %8, align 4, !tbaa !13
  %99 = add nsw i32 %98, 1
  br label %101

100:                                              ; preds = %92
  br label %101

101:                                              ; preds = %100, %97
  %102 = phi i32 [ %99, %97 ], [ 1, %100 ]
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %93, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !13
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !13
  %108 = icmp sgt i32 %107, 1
  br i1 %108, label %109, label %112

109:                                              ; preds = %101
  %110 = load i32, ptr %8, align 4, !tbaa !13
  %111 = sub nsw i32 %110, 1
  br label %114

112:                                              ; preds = %101
  %113 = load i32, ptr @Dimension, align 4, !tbaa !13
  br label %114

114:                                              ; preds = %112, %109
  %115 = phi i32 [ %111, %109 ], [ %113, %112 ]
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i32, ptr %106, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !13
  %119 = icmp slt i32 %105, %118
  br label %120

120:                                              ; preds = %114, %89
  %121 = phi i1 [ true, %89 ], [ %119, %114 ]
  %122 = zext i1 %121 to i32
  store i32 %122, ptr %11, align 4, !tbaa !13
  store i32 1, ptr %9, align 4, !tbaa !13
  br label %123

123:                                              ; preds = %152, %120
  %124 = load i32, ptr %9, align 4, !tbaa !13
  %125 = load i32, ptr %10, align 4, !tbaa !13
  %126 = icmp sle i32 %124, %125
  br i1 %126, label %127, label %155

127:                                              ; preds = %123
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load i32, ptr %8, align 4, !tbaa !13
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %129, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !13
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef @.str.13, i32 noundef %133) #5
  %135 = load i32, ptr %11, align 4, !tbaa !13
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %144

137:                                              ; preds = %127
  %138 = load i32, ptr %8, align 4, !tbaa !13
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %8, align 4, !tbaa !13
  %140 = load i32, ptr %10, align 4, !tbaa !13
  %141 = icmp sgt i32 %139, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %137
  store i32 1, ptr %8, align 4, !tbaa !13
  br label %143

143:                                              ; preds = %142, %137
  br label %151

144:                                              ; preds = %127
  %145 = load i32, ptr %8, align 4, !tbaa !13
  %146 = add nsw i32 %145, -1
  store i32 %146, ptr %8, align 4, !tbaa !13
  %147 = icmp slt i32 %146, 1
  br i1 %147, label %148, label %150

148:                                              ; preds = %144
  %149 = load i32, ptr %10, align 4, !tbaa !13
  store i32 %149, ptr %8, align 4, !tbaa !13
  br label %150

150:                                              ; preds = %148, %144
  br label %151

151:                                              ; preds = %150, %143
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %9, align 4, !tbaa !13
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %9, align 4, !tbaa !13
  br label %123, !llvm.loop !17

155:                                              ; preds = %123
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.14) #5
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = call i32 @fclose(ptr noundef %158)
  %160 = load i32, ptr @TraceLevel, align 4, !tbaa !13
  %161 = icmp sge i32 %160, 1
  br i1 %161, label %162, label %163

162:                                              ; preds = %155
  call void (ptr, ...) @printff(ptr noundef @.str.15)
  br label %163

163:                                              ; preds = %162, %155
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %164) #5
  store i32 0, ptr %14, align 4
  br label %165

165:                                              ; preds = %163, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %166 = load i32, ptr %14, align 4
  switch i32 %166, label %168 [
    i32 0, label %167
    i32 1, label %167
  ]

167:                                              ; preds = %165, %165
  ret void

168:                                              ; preds = %165
  unreachable
}

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

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

declare void @printff(ptr noundef, ...) #3

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

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

declare i32 @fclose(ptr noundef) #3

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !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"

@TraceLevel = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@TourFileName = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@OutputTourFileName = external dso_local local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__.WriteTour = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@Name = external dso_local local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@ProblemType = external dso_local local_unnamed_addr global i32, align 4
@Dimension = external dso_local local_unnamed_addr global i32, align 4
@.str.11 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @WriteTour(ptr noundef %0, ptr nocapture noundef readonly %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %5 = icmp eq ptr %0, null
  br i1 %5, label %79, label %6

6:                                                ; preds = %3
  %7 = tail call ptr @FullName(ptr noundef nonnull %0, i64 noundef %2)
  %8 = call i64 @time(ptr noundef nonnull %4) #7
  store i64 %8, ptr %4, align 8, !tbaa !5
  %9 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %11, label %18

11:                                               ; preds = %6
  %12 = load ptr, ptr @TourFileName, align 8, !tbaa !11
  %13 = icmp eq ptr %12, %0
  %14 = load ptr, ptr @OutputTourFileName, align 8
  %15 = icmp eq ptr %14, %0
  %16 = select i1 %15, ptr @.str.2, ptr @.str.3
  %17 = select i1 %13, ptr @.str.1, ptr %16
  call void (ptr, ...) @printff(ptr noundef nonnull @.str, ptr noundef nonnull %17, ptr noundef %7) #7
  br label %18

18:                                               ; preds = %11, %6
  %19 = call noalias ptr @fopen(ptr noundef %7, ptr noundef nonnull @.str.4)
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %20, label %21

20:                                               ; preds = %18
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 32, ptr noundef nonnull @__PRETTY_FUNCTION__.WriteTour) #8
  unreachable

21:                                               ; preds = %18
  %22 = load ptr, ptr @Name, align 8, !tbaa !11
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.7, ptr noundef %22, i64 noundef %2) #7
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.8, i64 noundef %2) #7
  %25 = call ptr @ctime(ptr noundef nonnull %4) #7
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.9, ptr noundef %25) #7
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.10) #7
  %28 = load i32, ptr @ProblemType, align 4, !tbaa !9
  %.not46 = icmp eq i32 %28, 1
  %29 = load i32, ptr @Dimension, align 4, !tbaa !9
  %30 = sdiv i32 %29, 2
  %31 = select i1 %.not46, i32 %30, i32 %29
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.11, i32 noundef %31) #7
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.12) #7
  %34 = icmp sgt i32 %31, 1
  br i1 %34, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %21
  %35 = zext nneg i32 %31 to i64
  %wide.trip.count = zext nneg i32 %31 to i64
  %36 = getelementptr inbounds i8, ptr %1, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %.not4775 = icmp eq i32 %37, 1
  br i1 %.not4775, label %.critedge, label %.lr.ph77

.lr.ph:                                           ; preds = %.lr.ph77
  %38 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %.not47 = icmp eq i32 %39, 1
  br i1 %.not47, label %.lr.ph..critedge.loopexit.split.loop.exit67_crit_edge, label %.lr.ph77, !llvm.loop !13

.lr.ph77:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv76 = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv76, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge.loopexit, label %.lr.ph, !llvm.loop !13

.lr.ph..critedge.loopexit.split.loop.exit67_crit_edge: ; preds = %.lr.ph
  %40 = icmp ult i64 %indvars.iv.next, %35
  %41 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %.critedge

.critedge.loopexit:                               ; preds = %.lr.ph77
  %42 = icmp ult i64 %indvars.iv.next, %35
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph.preheader, %.lr.ph..critedge.loopexit.split.loop.exit67_crit_edge, %21
  %.0.lcssa = phi i32 [ 1, %21 ], [ %41, %.lr.ph..critedge.loopexit.split.loop.exit67_crit_edge ], [ 1, %.lr.ph.preheader ], [ %31, %.critedge.loopexit ]
  %.lcssa = phi i1 [ false, %21 ], [ %40, %.lr.ph..critedge.loopexit.split.loop.exit67_crit_edge ], [ true, %.lr.ph.preheader ], [ %42, %.critedge.loopexit ]
  %43 = load i32, ptr @ProblemType, align 4, !tbaa !9
  %44 = icmp eq i32 %43, 1
  %.not485563 = icmp slt i32 %31, 1
  br i1 %44, label %.thread, label %45

45:                                               ; preds = %.critedge
  br i1 %.not485563, label %._crit_edge, label %.lr.ph58

.thread:                                          ; preds = %.critedge
  br i1 %.not485563, label %._crit_edge, label %.lr.ph58.split.us.preheader

.lr.ph58:                                         ; preds = %45
  %46 = add nuw nsw i32 %.0.lcssa, 1
  %47 = zext nneg i32 %46 to i64
  %48 = select i1 %.lcssa, i64 %47, i64 1
  %49 = getelementptr inbounds i32, ptr %1, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = icmp ugt i32 %.0.lcssa, 1
  %52 = add nsw i32 %.0.lcssa, -1
  %53 = load i32, ptr @Dimension, align 4
  %54 = select i1 %51, i32 %52, i32 %53
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %1, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = icmp slt i32 %50, %57
  %59 = freeze i1 %58
  br i1 %59, label %.lr.ph58.split.us.preheader, label %.lr.ph58.split

.lr.ph58.split.us.preheader:                      ; preds = %.thread, %.lr.ph58
  br label %.lr.ph58.split.us

.lr.ph58.split.us:                                ; preds = %.lr.ph58.split.us.preheader, %.lr.ph58.split.us
  %.157.us = phi i32 [ %spec.store.select.us, %.lr.ph58.split.us ], [ %.0.lcssa, %.lr.ph58.split.us.preheader ]
  %.04156.us = phi i32 [ %65, %.lr.ph58.split.us ], [ 1, %.lr.ph58.split.us.preheader ]
  %60 = sext i32 %.157.us to i64
  %61 = getelementptr inbounds i32, ptr %1, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.13, i32 noundef %62) #7
  %64 = add nsw i32 %.157.us, 1
  %.not49.us = icmp slt i32 %.157.us, %31
  %spec.store.select.us = select i1 %.not49.us, i32 %64, i32 1
  %65 = add nuw i32 %.04156.us, 1
  %exitcond61.not = icmp eq i32 %.04156.us, %31
  br i1 %exitcond61.not, label %._crit_edge, label %.lr.ph58.split.us, !llvm.loop !15

.lr.ph58.split:                                   ; preds = %.lr.ph58, %.lr.ph58.split
  %.157 = phi i32 [ %spec.select, %.lr.ph58.split ], [ %.0.lcssa, %.lr.ph58 ]
  %.04156 = phi i32 [ %72, %.lr.ph58.split ], [ 1, %.lr.ph58 ]
  %66 = sext i32 %.157 to i64
  %67 = getelementptr inbounds i32, ptr %1, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.13, i32 noundef %68) #7
  %70 = add nsw i32 %.157, -1
  %71 = icmp slt i32 %.157, 2
  %spec.select = select i1 %71, i32 %31, i32 %70
  %72 = add nuw i32 %.04156, 1
  %exitcond60.not = icmp eq i32 %.04156, %31
  br i1 %exitcond60.not, label %._crit_edge, label %.lr.ph58.split, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph58.split, %.lr.ph58.split.us, %.thread, %45
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.14) #7
  %74 = call i32 @fclose(ptr noundef nonnull %19)
  %75 = load i32, ptr @TraceLevel, align 4, !tbaa !9
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %._crit_edge
  call void (ptr, ...) @printff(ptr noundef nonnull @.str.15) #7
  br label %78

78:                                               ; preds = %77, %._crit_edge
  call void @free(ptr noundef %7) #7
  br label %79

79:                                               ; preds = %3, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden ptr @FullName(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #2

declare void @printff(ptr noundef, ...) local_unnamed_addr #3

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

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

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

; Function Attrs: nounwind
declare ptr @ctime(ptr noundef) local_unnamed_addr #2

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

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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