; LLVM IR from pmla/polyhedral-template-matching :: main (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.demonbrdata_t = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.96 = external hidden unnamed_addr constant [14 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.demonbrdata_t, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [9 x i32], align 16
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca [19 x i8], align 16
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca [4 x double], align 16
  %25 = alloca [9 x double], align 16
  %26 = alloca [3 x double], align 16
  %27 = alloca [9 x double], align 16
  %28 = alloca [9 x double], align 16
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %30 = call i32 @ptm_initialize_global()
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #9
  %31 = call noundef i64 @_ZN3ptm9run_testsEv()
  store i64 %31, ptr %2, align 8, !tbaa !5
  %32 = load i64, ptr %2, align 8, !tbaa !5
  %33 = icmp eq i64 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %0
  br label %37

35:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.89, i32 noundef 99, ptr noundef @__PRETTY_FUNCTION__.main) #10
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #9
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  store ptr null, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  store ptr null, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %38 = call noundef i32 @_ZL9read_filePKcPPhPm(ptr noundef @.str.90, ptr noundef %5, ptr noundef %3)
  store i32 %38, ptr %6, align 4, !tbaa !11
  %39 = load i32, ptr %6, align 4, !tbaa !11
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %150

42:                                               ; preds = %37
  %43 = call noundef i32 @_ZL9read_filePKcPPhPm(ptr noundef @.str.91, ptr noundef %4, ptr noundef %3)
  store i32 %43, ptr %6, align 4, !tbaa !11
  %44 = load i32, ptr %6, align 4, !tbaa !11
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %42
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %150

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %48 = load i64, ptr %3, align 8, !tbaa !5
  %49 = udiv i64 %48, 96
  %50 = trunc i64 %49 to i32
  store i32 %50, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #9
  %51 = getelementptr inbounds %struct.demonbrdata_t, ptr %9, i32 0, i32 0
  %52 = load ptr, ptr %5, align 8, !tbaa !9
  store ptr %52, ptr %51, align 8, !tbaa !13
  %53 = getelementptr inbounds %struct.demonbrdata_t, ptr %9, i32 0, i32 1
  %54 = load ptr, ptr %4, align 8, !tbaa !9
  store ptr %54, ptr %53, align 8, !tbaa !15
  %55 = load i32, ptr %8, align 4, !tbaa !11
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.92, i32 noundef %55)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %57 = load i32, ptr %8, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %58) #11
  store ptr %59, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %60 = load i32, ptr %8, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = call noalias ptr @calloc(i64 noundef 8, i64 noundef %61) #11
  store ptr %62, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %63 = load i32, ptr %8, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = call noalias ptr @calloc(i64 noundef 32, i64 noundef %64) #11
  store ptr %65, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #9
  call void @llvm.memset.p0.i64(ptr align 16 %13, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %66 = call ptr @ptm_initialize_local()
  store ptr %66, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  store double 0.000000e+00, ptr %15, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %67

67:                                               ; preds = %138, %47
  %68 = load i32, ptr %16, align 4, !tbaa !11
  %69 = load i32, ptr %8, align 4, !tbaa !11
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %141

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 19, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr %27) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr %28) #9
  %73 = load ptr, ptr %14, align 8, !tbaa !9
  %74 = load i32, ptr %16, align 4, !tbaa !11
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [4 x double], ptr %24, i64 0, i64 0
  %77 = getelementptr inbounds [9 x double], ptr %25, i64 0, i64 0
  %78 = getelementptr inbounds [3 x double], ptr %26, i64 0, i64 0
  %79 = getelementptr inbounds [9 x double], ptr %27, i64 0, i64 0
  %80 = getelementptr inbounds [9 x double], ptr %28, i64 0, i64 0
  %81 = getelementptr inbounds [19 x i8], ptr %17, i64 0, i64 0
  %82 = call i32 @ptm_index(ptr noundef %73, i64 noundef %75, ptr noundef @_ZL14get_neighboursPvmmiPiPmS0_PA3_d, ptr noundef %9, i32 noundef 255, i1 noundef zeroext true, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef %21, ptr noundef %76, ptr noundef %77, ptr noundef %78, ptr noundef %79, ptr noundef %80, ptr noundef %22, ptr noundef %23, ptr noundef null, ptr noundef null, ptr noundef %81)
  %83 = load i32, ptr %18, align 4, !tbaa !11
  %84 = trunc i32 %83 to i8
  %85 = load ptr, ptr %10, align 8, !tbaa !9
  %86 = load i32, ptr %16, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i8, ptr %85, i64 %87
  store i8 %84, ptr %88, align 1, !tbaa !18
  %89 = load double, ptr %21, align 8, !tbaa !16
  %90 = load ptr, ptr %11, align 8, !tbaa !9
  %91 = load i32, ptr %16, align 4, !tbaa !11
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  store double %89, ptr %93, align 8, !tbaa !16
  %94 = load ptr, ptr %12, align 8, !tbaa !9
  %95 = load i32, ptr %16, align 4, !tbaa !11
  %96 = mul nsw i32 %95, 4
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %94, i64 %97
  %99 = getelementptr inbounds [4 x double], ptr %24, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %98, ptr align 16 %99, i64 32, i1 false)
  %100 = load i32, ptr %18, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [9 x i32], ptr %13, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !11
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %102, align 4, !tbaa !11
  %105 = load i32, ptr %18, align 4, !tbaa !11
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %111

107:                                              ; preds = %72
  %108 = load double, ptr %21, align 8, !tbaa !16
  %109 = load double, ptr %15, align 8, !tbaa !16
  %110 = fadd double %109, %108
  store double %110, ptr %15, align 8, !tbaa !16
  br label %111

111:                                              ; preds = %107, %72
  %112 = load i32, ptr %16, align 4, !tbaa !11
  %113 = srem i32 %112, 1000
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %120, label %115

115:                                              ; preds = %111
  %116 = load i32, ptr %16, align 4, !tbaa !11
  %117 = load i32, ptr %8, align 4, !tbaa !11
  %118 = sub nsw i32 %117, 1
  %119 = icmp eq i32 %116, %118
  br i1 %119, label %120, label %137

120:                                              ; preds = %115, %111
  %121 = call i32 (ptr, ...) @printf(ptr noundef @.str.93)
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  store i32 0, ptr %29, align 4, !tbaa !11
  br label %122

122:                                              ; preds = %132, %120
  %123 = load i32, ptr %29, align 4, !tbaa !11
  %124 = icmp slt i32 %123, 9
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %135

126:                                              ; preds = %122
  %127 = load i32, ptr %29, align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [9 x i32], ptr %13, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !11
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.94, i32 noundef %130)
  br label %132

132:                                              ; preds = %126
  %133 = load i32, ptr %29, align 4, !tbaa !11
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %29, align 4, !tbaa !11
  br label %122, !llvm.loop !19

135:                                              ; preds = %125
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.95)
  br label %137

137:                                              ; preds = %135, %115
  call void @llvm.lifetime.end.p0(i64 72, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 19, ptr %17) #9
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %16, align 4, !tbaa !11
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %16, align 4, !tbaa !11
  br label %67, !llvm.loop !21

141:                                              ; preds = %71
  %142 = load double, ptr %15, align 8, !tbaa !16
  %143 = call i32 (ptr, ...) @printf(ptr noundef @.str.96, double noundef %142)
  %144 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %144) #9
  %145 = load ptr, ptr %11, align 8, !tbaa !9
  call void @free(ptr noundef %145) #9
  %146 = load ptr, ptr %12, align 8, !tbaa !9
  call void @free(ptr noundef %146) #9
  %147 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %147) #9
  %148 = load ptr, ptr %4, align 8, !tbaa !9
  call void @free(ptr noundef %148) #9
  %149 = load ptr, ptr %14, align 8, !tbaa !9
  call void @ptm_uninitialize_local(ptr noundef %149)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %150

150:                                              ; preds = %141, %46, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #9
  %151 = load i32, ptr %1, align 4
  ret i32 %151
}

declare i32 @ptm_initialize_global() #3

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

declare noundef i64 @_ZN3ptm9run_testsEv() #3

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL9read_filePKcPPhPm(ptr noundef, ptr noundef, ptr noundef) #6

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #7

declare ptr @ptm_initialize_local() #3

declare i32 @ptm_index(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL14get_neighboursPvmmiPiPmS0_PA3_d(ptr noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #6

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

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

declare void @ptm_uninitialize_local(ptr noundef) #3

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 allocsize(0,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 #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(0,1) }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS13demonbrdata_t", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; 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.demonbrdata_t = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.96 = external hidden unnamed_addr constant [14 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 norecurse uwtable
define dso_local noundef range(i32 -1, 1) i32 @main() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.demonbrdata_t, align 8
  %5 = alloca [9 x i32], align 16
  %6 = alloca [19 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca [4 x double], align 16
  %14 = alloca [9 x double], align 16
  %15 = alloca [3 x double], align 16
  %16 = alloca [9 x double], align 16
  %17 = alloca [9 x double], align 16
  %18 = tail call i32 @ptm_initialize_global()
  %19 = tail call noundef i64 @_ZN3ptm9run_testsEv()
  %20 = icmp eq i64 %19, 0
  br i1 %20, label %22, label %21

21:                                               ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.89, i32 noundef 99, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

22:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  store i64 0, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store ptr null, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  store ptr null, ptr %3, align 8, !tbaa !9
  %23 = call noundef i32 @_ZL9read_filePKcPPhPm(ptr noundef nonnull @.str.90, ptr noundef nonnull %3, ptr noundef nonnull %1)
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %24, label %84

24:                                               ; preds = %22
  %25 = call noundef i32 @_ZL9read_filePKcPPhPm(ptr noundef nonnull @.str.91, ptr noundef nonnull %2, ptr noundef nonnull %1)
  %.not34 = icmp eq i32 %25, 0
  br i1 %.not34, label %26, label %84

26:                                               ; preds = %24
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %28 = udiv i64 %27, 96
  %29 = trunc i64 %28 to i32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  %30 = load ptr, ptr %3, align 8, !tbaa !9
  store ptr %30, ptr %4, align 8, !tbaa !11
  %31 = getelementptr inbounds i8, ptr %4, i64 8
  %32 = load ptr, ptr %2, align 8, !tbaa !9
  store ptr %32, ptr %31, align 8, !tbaa !13
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.92, i32 noundef %29)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %5) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %5, i8 0, i64 36, i1 false)
  %34 = call ptr @ptm_initialize_local()
  %35 = icmp sgt i32 %29, 0
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %26
  %36 = add nuw nsw i64 %28, 4294967295
  %37 = and i64 %36, 4294967295
  %wide.trip.count = and i64 %28, 2147483647
  %38 = getelementptr inbounds i8, ptr %5, i64 4
  %39 = getelementptr inbounds i8, ptr %5, i64 8
  %40 = getelementptr inbounds i8, ptr %5, i64 12
  %41 = getelementptr inbounds i8, ptr %5, i64 16
  %42 = getelementptr inbounds i8, ptr %5, i64 20
  %43 = getelementptr inbounds i8, ptr %5, i64 24
  %44 = getelementptr inbounds i8, ptr %5, i64 28
  %45 = getelementptr inbounds i8, ptr %5, i64 32
  br label %49

._crit_edge:                                      ; preds = %83, %26
  %.031.lcssa = phi double [ 0.000000e+00, %26 ], [ %.1, %83 ]
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.96, double noundef %.031.lcssa)
  %47 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %47) #9
  %48 = load ptr, ptr %2, align 8, !tbaa !9
  call void @free(ptr noundef %48) #9
  call void @ptm_uninitialize_local(ptr noundef %34)
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  br label %84

49:                                               ; preds = %.lr.ph, %83
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %83 ]
  %.03138 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1, %83 ]
  call void @llvm.lifetime.start.p0(i64 19, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %16) #9
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %17) #9
  %50 = call i32 @ptm_index(ptr noundef %34, i64 noundef %indvars.iv, ptr noundef nonnull @_ZL14get_neighboursPvmmiPiPmS0_PA3_d, ptr noundef nonnull %4, i32 noundef 255, i1 noundef zeroext true, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15, ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef null, ptr noundef null, ptr noundef nonnull %6)
  %51 = load i32, ptr %7, align 4, !tbaa !14
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [9 x i32], ptr %5, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !14
  %.not35 = icmp eq i32 %51, 0
  %56 = load double, ptr %10, align 8
  %57 = fadd double %.03138, %56
  %.1 = select i1 %.not35, double %.03138, double %57
  %58 = trunc nuw nsw i64 %indvars.iv to i32
  %59 = urem i32 %58, 1000
  %60 = icmp eq i32 %59, 0
  %61 = icmp eq i64 %indvars.iv, %37
  %or.cond = select i1 %60, i1 true, i1 %61
  br i1 %or.cond, label %62, label %83

62:                                               ; preds = %49
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.93)
  %64 = load i32, ptr %5, align 16, !tbaa !14
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %64)
  %66 = load i32, ptr %38, align 4, !tbaa !14
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %66)
  %68 = load i32, ptr %39, align 8, !tbaa !14
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %68)
  %70 = load i32, ptr %40, align 4, !tbaa !14
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %70)
  %72 = load i32, ptr %41, align 16, !tbaa !14
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %72)
  %74 = load i32, ptr %42, align 4, !tbaa !14
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %74)
  %76 = load i32, ptr %43, align 8, !tbaa !14
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %76)
  %78 = load i32, ptr %44, align 4, !tbaa !14
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %78)
  %80 = load i32, ptr %45, align 16, !tbaa !14
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, i32 noundef %80)
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.95)
  br label %83

83:                                               ; preds = %49, %62
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 19, ptr nonnull %6) #9
  %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, label %49, !llvm.loop !16

84:                                               ; preds = %24, %22, %._crit_edge
  %.032 = phi i32 [ 0, %._crit_edge ], [ -1, %22 ], [ -1, %24 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  ret i32 %.032
}

declare i32 @ptm_initialize_global() local_unnamed_addr #2

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

declare noundef i64 @_ZN3ptm9run_testsEv() local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL9read_filePKcPPhPm(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

declare ptr @ptm_initialize_local() local_unnamed_addr #2

declare i32 @ptm_index(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL14get_neighboursPvmmiPiPmS0_PA3_d(ptr noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #5

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

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

declare void @ptm_uninitialize_local(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress norecurse 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #7 = { 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 #8 = { noreturn nounwind }
attributes #9 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS13demonbrdata_t", !10, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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