; LLVM IR from robotics-upo/Heuristic_path_planners :: include/voro++-0.4.6/src/c_loops.ll (ZN4voro13c_loop_subset12setup_sphereEddddb)

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

%"class.voro::c_loop_subset" = type { %"class.voro::c_loop_base.base", i32, double, double, double, double, double, double, double, double, double, i8, i8, i8, double, double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%"class.voro::c_loop_base.base" = type <{ i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32 }>

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4voro13c_loop_subset12setup_sphereEddddb(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, i1 noundef zeroext %5) #0 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i8, align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !9
  store double %3, ptr %10, align 8, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !9
  %13 = zext i1 %5 to i8
  store i8 %13, ptr %12, align 1, !tbaa !11
  %14 = load ptr, ptr %7, align 8
  %15 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %16 = trunc i8 %15 to i1
  br i1 %16, label %17, label %29

17:                                               ; preds = %6
  %18 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 1
  store i32 0, ptr %18, align 4, !tbaa !15
  %19 = load double, ptr %8, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 20
  store double %19, ptr %20, align 8, !tbaa !20
  %21 = load double, ptr %9, align 8, !tbaa !9
  %22 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 21
  store double %21, ptr %22, align 8, !tbaa !21
  %23 = load double, ptr %10, align 8, !tbaa !9
  %24 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 22
  store double %23, ptr %24, align 8, !tbaa !22
  %25 = load double, ptr %11, align 8, !tbaa !9
  %26 = load double, ptr %11, align 8, !tbaa !9
  %27 = fmul double %25, %26
  %28 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 23
  store double %27, ptr %28, align 8, !tbaa !23
  br label %31

29:                                               ; preds = %6
  %30 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 1
  store i32 2, ptr %30, align 4, !tbaa !15
  br label %31

31:                                               ; preds = %29, %17
  %32 = load double, ptr %8, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 2
  %34 = load double, ptr %33, align 8, !tbaa !24
  %35 = fsub double %32, %34
  %36 = load double, ptr %11, align 8, !tbaa !9
  %37 = fsub double %35, %36
  %38 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 8
  %39 = load double, ptr %38, align 8, !tbaa !25
  %40 = fmul double %37, %39
  %41 = call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %14, double noundef %40)
  %42 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 26
  store i32 %41, ptr %42, align 8, !tbaa !26
  %43 = load double, ptr %8, align 8, !tbaa !9
  %44 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 2
  %45 = load double, ptr %44, align 8, !tbaa !24
  %46 = fsub double %43, %45
  %47 = load double, ptr %11, align 8, !tbaa !9
  %48 = fadd double %46, %47
  %49 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 8
  %50 = load double, ptr %49, align 8, !tbaa !25
  %51 = fmul double %48, %50
  %52 = call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %14, double noundef %51)
  %53 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 27
  store i32 %52, ptr %53, align 4, !tbaa !27
  %54 = load double, ptr %9, align 8, !tbaa !9
  %55 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 3
  %56 = load double, ptr %55, align 8, !tbaa !28
  %57 = fsub double %54, %56
  %58 = load double, ptr %11, align 8, !tbaa !9
  %59 = fsub double %57, %58
  %60 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 9
  %61 = load double, ptr %60, align 8, !tbaa !29
  %62 = fmul double %59, %61
  %63 = call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %14, double noundef %62)
  %64 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 28
  store i32 %63, ptr %64, align 8, !tbaa !30
  %65 = load double, ptr %9, align 8, !tbaa !9
  %66 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 3
  %67 = load double, ptr %66, align 8, !tbaa !28
  %68 = fsub double %65, %67
  %69 = load double, ptr %11, align 8, !tbaa !9
  %70 = fadd double %68, %69
  %71 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 9
  %72 = load double, ptr %71, align 8, !tbaa !29
  %73 = fmul double %70, %72
  %74 = call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %14, double noundef %73)
  %75 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 29
  store i32 %74, ptr %75, align 4, !tbaa !31
  %76 = load double, ptr %10, align 8, !tbaa !9
  %77 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 4
  %78 = load double, ptr %77, align 8, !tbaa !32
  %79 = fsub double %76, %78
  %80 = load double, ptr %11, align 8, !tbaa !9
  %81 = fsub double %79, %80
  %82 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 10
  %83 = load double, ptr %82, align 8, !tbaa !33
  %84 = fmul double %81, %83
  %85 = call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %14, double noundef %84)
  %86 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 30
  store i32 %85, ptr %86, align 8, !tbaa !34
  %87 = load double, ptr %10, align 8, !tbaa !9
  %88 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 4
  %89 = load double, ptr %88, align 8, !tbaa !32
  %90 = fsub double %87, %89
  %91 = load double, ptr %11, align 8, !tbaa !9
  %92 = fadd double %90, %91
  %93 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 10
  %94 = load double, ptr %93, align 8, !tbaa !33
  %95 = fmul double %92, %94
  %96 = call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %14, double noundef %95)
  %97 = getelementptr inbounds %"class.voro::c_loop_subset", ptr %14, i32 0, i32 31
  store i32 %96, ptr %97, align 4, !tbaa !35
  call void @_ZN4voro13c_loop_subset12setup_commonEv(ptr noundef nonnull align 8 dereferenceable(304) %14)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304), double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4voro13c_loop_subset12setup_commonEv(ptr noundef nonnull align 8 dereferenceable(304)) #0 align 2

attributes #0 = { 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 #1 = { inlinehint 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" }

!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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !19, i64 68}
!16 = !{!"_ZTSN4voro13c_loop_subsetE", !17, i64 0, !19, i64 68, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !12, i64 144, !12, i64 145, !12, i64 146, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !18, i64 248, !18, i64 252, !18, i64 256, !18, i64 260, !18, i64 264, !18, i64 268, !18, i64 272, !18, i64 276, !18, i64 280, !18, i64 284, !18, i64 288, !18, i64 292, !18, i64 296, !18, i64 300}
!17 = !{!"_ZTSN4voro11c_loop_baseE", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !18, i64 16, !18, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !18, i64 48, !18, i64 52, !18, i64 56, !18, i64 60, !18, i64 64}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN4voro18c_loop_subset_modeE", !7, i64 0}
!20 = !{!16, !10, i64 200}
!21 = !{!16, !10, i64 208}
!22 = !{!16, !10, i64 216}
!23 = !{!16, !10, i64 224}
!24 = !{!16, !10, i64 72}
!25 = !{!16, !10, i64 120}
!26 = !{!16, !18, i64 248}
!27 = !{!16, !18, i64 252}
!28 = !{!16, !10, i64 80}
!29 = !{!16, !10, i64 128}
!30 = !{!16, !18, i64 256}
!31 = !{!16, !18, i64 260}
!32 = !{!16, !10, i64 88}
!33 = !{!16, !10, i64 136}
!34 = !{!16, !18, i64 264}
!35 = !{!16, !18, i64 268}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4voro13c_loop_subset12setup_sphereEddddb(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, i1 noundef zeroext %5) local_unnamed_addr #0 align 2 {
  br i1 %5, label %7, label %13

7:                                                ; preds = %6
  %8 = getelementptr inbounds i8, ptr %0, i64 200
  store double %1, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 208
  store double %2, ptr %9, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %0, i64 216
  store double %3, ptr %10, align 8, !tbaa !16
  %11 = fmul double %4, %4
  %12 = getelementptr inbounds i8, ptr %0, i64 224
  store double %11, ptr %12, align 8, !tbaa !17
  br label %13

13:                                               ; preds = %6, %7
  %.sink = phi i32 [ 0, %7 ], [ 2, %6 ]
  %14 = getelementptr inbounds i8, ptr %0, i64 68
  store i32 %.sink, ptr %14, align 4
  %15 = getelementptr inbounds i8, ptr %0, i64 72
  %16 = load double, ptr %15, align 8, !tbaa !18
  %17 = fsub double %1, %16
  %18 = fsub double %17, %4
  %19 = getelementptr inbounds i8, ptr %0, i64 120
  %20 = load double, ptr %19, align 8, !tbaa !19
  %21 = fmul double %20, %18
  %22 = tail call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %21)
  %23 = getelementptr inbounds i8, ptr %0, i64 248
  store i32 %22, ptr %23, align 8, !tbaa !20
  %24 = load double, ptr %15, align 8, !tbaa !18
  %25 = fsub double %1, %24
  %26 = fadd double %25, %4
  %27 = load double, ptr %19, align 8, !tbaa !19
  %28 = fmul double %27, %26
  %29 = tail call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %28)
  %30 = getelementptr inbounds i8, ptr %0, i64 252
  store i32 %29, ptr %30, align 4, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %0, i64 80
  %32 = load double, ptr %31, align 8, !tbaa !22
  %33 = fsub double %2, %32
  %34 = fsub double %33, %4
  %35 = getelementptr inbounds i8, ptr %0, i64 128
  %36 = load double, ptr %35, align 8, !tbaa !23
  %37 = fmul double %36, %34
  %38 = tail call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %37)
  %39 = getelementptr inbounds i8, ptr %0, i64 256
  store i32 %38, ptr %39, align 8, !tbaa !24
  %40 = load double, ptr %31, align 8, !tbaa !22
  %41 = fsub double %2, %40
  %42 = fadd double %41, %4
  %43 = load double, ptr %35, align 8, !tbaa !23
  %44 = fmul double %43, %42
  %45 = tail call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %44)
  %46 = getelementptr inbounds i8, ptr %0, i64 260
  store i32 %45, ptr %46, align 4, !tbaa !25
  %47 = getelementptr inbounds i8, ptr %0, i64 88
  %48 = load double, ptr %47, align 8, !tbaa !26
  %49 = fsub double %3, %48
  %50 = fsub double %49, %4
  %51 = getelementptr inbounds i8, ptr %0, i64 136
  %52 = load double, ptr %51, align 8, !tbaa !27
  %53 = fmul double %52, %50
  %54 = tail call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %53)
  %55 = getelementptr inbounds i8, ptr %0, i64 264
  store i32 %54, ptr %55, align 8, !tbaa !28
  %56 = load double, ptr %47, align 8, !tbaa !26
  %57 = fsub double %3, %56
  %58 = fadd double %57, %4
  %59 = load double, ptr %51, align 8, !tbaa !27
  %60 = fmul double %59, %58
  %61 = tail call noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304) %0, double noundef %60)
  %62 = getelementptr inbounds i8, ptr %0, i64 268
  store i32 %61, ptr %62, align 4, !tbaa !29
  tail call void @_ZN4voro13c_loop_subset12setup_commonEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4voro13c_loop_subset8step_intEd(ptr noundef nonnull align 8 dereferenceable(304), double noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4voro13c_loop_subset12setup_commonEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { inlinehint 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" }

!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, !13, i64 200}
!6 = !{!"_ZTSN4voro13c_loop_subsetE", !7, i64 0, !12, i64 68, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !14, i64 144, !14, i64 145, !14, i64 146, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240, !8, i64 248, !8, i64 252, !8, i64 256, !8, i64 260, !8, i64 264, !8, i64 268, !8, i64 272, !8, i64 276, !8, i64 280, !8, i64 284, !8, i64 288, !8, i64 292, !8, i64 296, !8, i64 300}
!7 = !{!"_ZTSN4voro11c_loop_baseE", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !11, i64 24, !11, i64 32, !11, i64 40, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60, !8, i64 64}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_ZTSN4voro18c_loop_subset_modeE", !9, i64 0}
!13 = !{!"double", !9, i64 0}
!14 = !{!"bool", !9, i64 0}
!15 = !{!6, !13, i64 208}
!16 = !{!6, !13, i64 216}
!17 = !{!6, !13, i64 224}
!18 = !{!6, !13, i64 72}
!19 = !{!6, !13, i64 120}
!20 = !{!6, !8, i64 248}
!21 = !{!6, !8, i64 252}
!22 = !{!6, !13, i64 80}
!23 = !{!6, !13, i64 128}
!24 = !{!6, !8, i64 256}
!25 = !{!6, !8, i64 260}
!26 = !{!6, !13, i64 88}
!27 = !{!6, !13, i64 136}
!28 = !{!6, !8, i64 264}
!29 = !{!6, !8, i64 268}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,TailCallElimPass