; LLVM IR from Yinxiaoli/iros2015_folding :: src/folding_planner/src/distancefield.ll (Z15generateSDFGridR8SSDFGrid)

; 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.SSDFPoint = type { double, double }
%struct.SSDFGrid = type { ptr, i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15generateSDFGridR8SSDFGrid(ptr noundef nonnull align 8 dereferenceable(16) %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.SSDFPoint, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.SSDFPoint, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.SSDFPoint, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.SSDFPoint, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %84, %1
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.SSDFGrid, ptr %16, i32 0, i32 2
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = icmp slt i32 %15, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %14
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %87

21:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %53, %21
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.SSDFGrid, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !13
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %56

29:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = load i32, ptr %3, align 4, !tbaa !9
  %33 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %30, i32 noundef %31, i32 noundef %32)
  %34 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  %35 = extractvalue { double, double } %33, 0
  store double %35, ptr %34, align 8
  %36 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  %37 = extractvalue { double, double } %33, 1
  store double %37, ptr %36, align 8
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !9
  %40 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %39, i32 noundef %40, i32 noundef -1, i32 noundef 0)
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %42, i32 noundef %43, i32 noundef 0, i32 noundef -1)
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = load i32, ptr %5, align 4, !tbaa !9
  %46 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %45, i32 noundef %46, i32 noundef -1, i32 noundef -1)
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %48, i32 noundef %49, i32 noundef 1, i32 noundef -1)
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %50, i32 noundef %51, i32 noundef %52, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  br label %53

53:                                               ; preds = %29
  %54 = load i32, ptr %5, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %5, align 4, !tbaa !9
  br label %22, !llvm.loop !14

56:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.SSDFGrid, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 8, !tbaa !13
  %60 = sub nsw i32 %59, 1
  store i32 %60, ptr %7, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %80, %56
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = icmp sge i32 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %83

65:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = load i32, ptr %3, align 4, !tbaa !9
  %69 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %66, i32 noundef %67, i32 noundef %68)
  %70 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %71 = extractvalue { double, double } %69, 0
  store double %71, ptr %70, align 8
  %72 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %73 = extractvalue { double, double } %69, 1
  store double %73, ptr %72, align 8
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef %75, i32 noundef %76, i32 noundef 1, i32 noundef 0)
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = load i32, ptr %3, align 4, !tbaa !9
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %77, i32 noundef %78, i32 noundef %79, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  br label %80

80:                                               ; preds = %65
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = add nsw i32 %81, -1
  store i32 %82, ptr %7, align 4, !tbaa !9
  br label %61, !llvm.loop !16

83:                                               ; preds = %64
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %3, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %3, align 4, !tbaa !9
  br label %14, !llvm.loop !17

87:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.SSDFGrid, ptr %88, i32 0, i32 2
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = sub nsw i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %159, %87
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = icmp sge i32 %93, 0
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %162

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.SSDFGrid, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 8, !tbaa !13
  %100 = sub nsw i32 %99, 1
  store i32 %100, ptr %10, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %129, %96
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = icmp sge i32 %102, 0
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %132

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #3
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %106, i32 noundef %107, i32 noundef %108)
  %110 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %111 = extractvalue { double, double } %109, 0
  store double %111, ptr %110, align 8
  %112 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %113 = extractvalue { double, double } %109, 1
  store double %113, ptr %112, align 8
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = load i32, ptr %10, align 4, !tbaa !9
  %116 = load i32, ptr %9, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %114, ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %115, i32 noundef %116, i32 noundef 1, i32 noundef 0)
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = load i32, ptr %9, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %117, ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %118, i32 noundef %119, i32 noundef 0, i32 noundef 1)
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = load i32, ptr %9, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %120, ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %121, i32 noundef %122, i32 noundef -1, i32 noundef 1)
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = load i32, ptr %9, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %123, ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %124, i32 noundef %125, i32 noundef 1, i32 noundef 1)
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  %127 = load i32, ptr %10, align 4, !tbaa !9
  %128 = load i32, ptr %9, align 4, !tbaa !9
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %126, i32 noundef %127, i32 noundef %128, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  br label %129

129:                                              ; preds = %105
  %130 = load i32, ptr %10, align 4, !tbaa !9
  %131 = add nsw i32 %130, -1
  store i32 %131, ptr %10, align 4, !tbaa !9
  br label %101, !llvm.loop !18

132:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %155, %132
  %134 = load i32, ptr %12, align 4, !tbaa !9
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.SSDFGrid, ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !13
  %138 = icmp slt i32 %134, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %133
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %158

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #3
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = load i32, ptr %12, align 4, !tbaa !9
  %143 = load i32, ptr %9, align 4, !tbaa !9
  %144 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %141, i32 noundef %142, i32 noundef %143)
  %145 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %146 = extractvalue { double, double } %144, 0
  store double %146, ptr %145, align 8
  %147 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %148 = extractvalue { double, double } %144, 1
  store double %148, ptr %147, align 8
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = load i32, ptr %9, align 4, !tbaa !9
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %149, ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %150, i32 noundef %151, i32 noundef -1, i32 noundef 0)
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = load i32, ptr %9, align 4, !tbaa !9
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %152, i32 noundef %153, i32 noundef %154, ptr noundef nonnull align 8 dereferenceable(16) %13)
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  br label %155

155:                                              ; preds = %140
  %156 = load i32, ptr %12, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %12, align 4, !tbaa !9
  br label %133, !llvm.loop !19

158:                                              ; preds = %139
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %9, align 4, !tbaa !9
  %161 = add nsw i32 %160, -1
  store i32 %161, ptr %9, align 4, !tbaa !9
  br label %92, !llvm.loop !20

162:                                              ; preds = %95
  ret void
}

attributes #0 = { mustprogress 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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"_ZTS8SSDFGrid", !6, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}


; 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.SSDFPoint = type { double, double }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15generateSDFGridR8SSDFGrid(ptr noundef nonnull align 8 dereferenceable(16) %0) local_unnamed_addr #1 {
  %2 = alloca %struct.SSDFPoint, align 8
  %3 = alloca %struct.SSDFPoint, align 8
  %4 = alloca %struct.SSDFPoint, align 8
  %5 = alloca %struct.SSDFPoint, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader80.lr.ph, label %._crit_edge95

.preheader80.lr.ph:                               ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  br label %.preheader80

.preheader80:                                     ; preds = %.preheader80.lr.ph, %._crit_edge
  %.07585 = phi i32 [ 0, %.preheader80.lr.ph ], [ %25, %._crit_edge ]
  %12 = load i32, ptr %9, align 8, !tbaa !11
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.preheader78:                                     ; preds = %._crit_edge
  %14 = icmp sgt i32 %26, 0
  br i1 %14, label %.lr.ph94, label %._crit_edge95

.lr.ph94:                                         ; preds = %.preheader78
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = getelementptr inbounds i8, ptr %4, i64 8
  %17 = getelementptr inbounds i8, ptr %5, i64 8
  %.pre = load i32, ptr %15, align 8, !tbaa !11
  br label %34

.preheader79:                                     ; preds = %.lr.ph
  %18 = icmp sgt i32 %23, 0
  br i1 %18, label %.lr.ph84, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader80, %.lr.ph
  %.07482 = phi i32 [ %22, %.lr.ph ], [ 0, %.preheader80 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #3
  %19 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.07482, i32 noundef %.07585)
  %20 = extractvalue { double, double } %19, 0
  store double %20, ptr %2, align 8
  %21 = extractvalue { double, double } %19, 1
  store double %21, ptr %10, align 8
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.07482, i32 noundef %.07585, i32 noundef -1, i32 noundef 0)
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.07482, i32 noundef %.07585, i32 noundef 0, i32 noundef -1)
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.07482, i32 noundef %.07585, i32 noundef -1, i32 noundef -1)
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.07482, i32 noundef %.07585, i32 noundef 1, i32 noundef -1)
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.07482, i32 noundef %.07585, ptr noundef nonnull align 8 dereferenceable(16) %2)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #3
  %22 = add nuw nsw i32 %.07482, 1
  %23 = load i32, ptr %9, align 8, !tbaa !11
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %.lr.ph, label %.preheader79, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph84, %.preheader80, %.preheader79
  %25 = add nuw nsw i32 %.07585, 1
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.preheader80, label %.preheader78, !llvm.loop !14

.lr.ph84:                                         ; preds = %.preheader79, %.lr.ph84
  %.073.in83 = phi i32 [ %.073, %.lr.ph84 ], [ %23, %.preheader79 ]
  %.073 = add nsw i32 %.073.in83, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  %28 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.073, i32 noundef %.07585)
  %29 = extractvalue { double, double } %28, 0
  store double %29, ptr %3, align 8
  %30 = extractvalue { double, double } %28, 1
  store double %30, ptr %11, align 8
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.073, i32 noundef %.07585, i32 noundef 1, i32 noundef 0)
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.073, i32 noundef %.07585, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  %31 = icmp ugt i32 %.073.in83, 1
  br i1 %31, label %.lr.ph84, label %._crit_edge, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph91, %34, %.preheader
  %32 = phi i32 [ %.pre98, %.preheader ], [ %35, %34 ], [ %46, %.lr.ph91 ]
  %33 = icmp sgt i32 %.07293.in, 1
  br i1 %33, label %34, label %._crit_edge95, !llvm.loop !16

._crit_edge95:                                    ; preds = %.loopexit, %1, %.preheader78
  ret void

34:                                               ; preds = %.lr.ph94, %.loopexit
  %35 = phi i32 [ %.pre, %.lr.ph94 ], [ %32, %.loopexit ]
  %.07293.in = phi i32 [ %26, %.lr.ph94 ], [ %.07293, %.loopexit ]
  %.07293 = add nsw i32 %.07293.in, -1
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph89, label %.loopexit

.preheader:                                       ; preds = %.lr.ph89
  %.pre98 = load i32, ptr %15, align 8, !tbaa !11
  %37 = icmp sgt i32 %.pre98, 0
  br i1 %37, label %.lr.ph91, label %.loopexit

.lr.ph89:                                         ; preds = %34, %.lr.ph89
  %.071.in87 = phi i32 [ %.071, %.lr.ph89 ], [ %35, %34 ]
  %.071 = add nsw i32 %.071.in87, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %38 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.071, i32 noundef %.07293)
  %39 = extractvalue { double, double } %38, 0
  store double %39, ptr %4, align 8
  %40 = extractvalue { double, double } %38, 1
  store double %40, ptr %16, align 8
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.071, i32 noundef %.07293, i32 noundef 1, i32 noundef 0)
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.071, i32 noundef %.07293, i32 noundef 0, i32 noundef 1)
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.071, i32 noundef %.07293, i32 noundef -1, i32 noundef 1)
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %.071, i32 noundef %.07293, i32 noundef 1, i32 noundef 1)
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.071, i32 noundef %.07293, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  %41 = icmp ugt i32 %.071.in87, 1
  br i1 %41, label %.lr.ph89, label %.preheader, !llvm.loop !17

.lr.ph91:                                         ; preds = %.preheader, %.lr.ph91
  %.090 = phi i32 [ %45, %.lr.ph91 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  %42 = call { double, double } @_Z8getPointR8SSDFGridii(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.090, i32 noundef %.07293)
  %43 = extractvalue { double, double } %42, 0
  store double %43, ptr %5, align 8
  %44 = extractvalue { double, double } %42, 1
  store double %44, ptr %17, align 8
  call void @_Z12compareValueR8SSDFGridR9SSDFPointiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.090, i32 noundef %.07293, i32 noundef -1, i32 noundef 0)
  call void @_Z8putPointR8SSDFGridiiRK9SSDFPoint(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.090, i32 noundef %.07293, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  %45 = add nuw nsw i32 %.090, 1
  %46 = load i32, ptr %15, align 8, !tbaa !11
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph91, label %.loopexit, !llvm.loop !18
}

attributes #0 = { mustprogress 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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, !10, i64 12}
!6 = !{!"_ZTS8SSDFGrid", !7, i64 0, !10, i64 8, !10, i64 12}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}


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