; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/External/fastjet-3.0.0/plugins/SISCone/siscone/siscone/geo_ee3b23e7 (rangeC2Eddd)

; 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.siscone::Ceta_phi_range" = type { i32, i32 }

@_ZN7siscone14Ceta_phi_range7eta_minE = external dso_local global double, align 8
@_ZN7siscone14Ceta_phi_range7eta_maxE = external dso_local global double, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7siscone14Ceta_phi_rangeC2Eddd(ptr noundef nonnull align 4 dereferenceable(8) %0, double noundef %1, double noundef %2, double noundef %3) unnamed_addr #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store double %2, ptr %7, align 8, !tbaa !9
  store double %3, ptr %8, align 8, !tbaa !9
  %17 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %18 = load double, ptr %6, align 8, !tbaa !9
  %19 = load double, ptr %8, align 8, !tbaa !9
  %20 = fsub double %18, %19
  store double %20, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %21 = load double, ptr @_ZN7siscone14Ceta_phi_range7eta_minE, align 8, !tbaa !9
  %22 = fadd double %21, 1.000000e-04
  store double %22, ptr %11, align 8, !tbaa !9
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %24 = load double, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  store double %24, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %25 = load double, ptr %6, align 8, !tbaa !9
  %26 = load double, ptr %8, align 8, !tbaa !9
  %27 = fadd double %25, %26
  store double %27, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %28 = load double, ptr @_ZN7siscone14Ceta_phi_range7eta_maxE, align 8, !tbaa !9
  %29 = fsub double %28, 1.000000e-04
  store double %29, ptr %14, align 8, !tbaa !9
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %31 = load double, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  store double %31, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %32 = load double, ptr %9, align 8, !tbaa !9
  %33 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_eta_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %17, double noundef %32)
  store i32 %33, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %34 = load double, ptr %12, align 8, !tbaa !9
  %35 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_eta_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %17, double noundef %34)
  store i32 %35, ptr %16, align 4, !tbaa !11
  %36 = load i32, ptr %16, align 4, !tbaa !11
  %37 = load i32, ptr %15, align 4, !tbaa !11
  %38 = sub i32 %36, %37
  %39 = load i32, ptr %16, align 4, !tbaa !11
  %40 = add i32 %38, %39
  %41 = getelementptr inbounds %"class.siscone::Ceta_phi_range", ptr %17, i32 0, i32 0
  store i32 %40, ptr %41, align 4, !tbaa !13
  %42 = load double, ptr %7, align 8, !tbaa !9
  %43 = load double, ptr %8, align 8, !tbaa !9
  %44 = fsub double %42, %43
  %45 = call noundef double @_ZN7siscone12phi_in_rangeEd(double noundef %44)
  store double %45, ptr %9, align 8, !tbaa !9
  %46 = load double, ptr %7, align 8, !tbaa !9
  %47 = load double, ptr %8, align 8, !tbaa !9
  %48 = fadd double %46, %47
  %49 = call noundef double @_ZN7siscone12phi_in_rangeEd(double noundef %48)
  store double %49, ptr %12, align 8, !tbaa !9
  %50 = load double, ptr %9, align 8, !tbaa !9
  %51 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_phi_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %17, double noundef %50)
  store i32 %51, ptr %15, align 4, !tbaa !11
  %52 = load double, ptr %12, align 8, !tbaa !9
  %53 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_phi_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %17, double noundef %52)
  store i32 %53, ptr %16, align 4, !tbaa !11
  %54 = load double, ptr %12, align 8, !tbaa !9
  %55 = load double, ptr %9, align 8, !tbaa !9
  %56 = fcmp ogt double %54, %55
  br i1 %56, label %57, label %64

57:                                               ; preds = %4
  %58 = load i32, ptr %16, align 4, !tbaa !11
  %59 = load i32, ptr %15, align 4, !tbaa !11
  %60 = sub i32 %58, %59
  %61 = load i32, ptr %16, align 4, !tbaa !11
  %62 = add i32 %60, %61
  %63 = getelementptr inbounds %"class.siscone::Ceta_phi_range", ptr %17, i32 0, i32 1
  store i32 %62, ptr %63, align 4, !tbaa !15
  br label %79

64:                                               ; preds = %4
  %65 = load i32, ptr %15, align 4, !tbaa !11
  %66 = load i32, ptr %16, align 4, !tbaa !11
  %67 = icmp eq i32 %65, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  br label %76

69:                                               ; preds = %64
  %70 = load i32, ptr %15, align 4, !tbaa !11
  %71 = load i32, ptr %16, align 4, !tbaa !11
  %72 = sub i32 %70, %71
  %73 = xor i32 -1, %72
  %74 = load i32, ptr %16, align 4, !tbaa !11
  %75 = add i32 %73, %74
  br label %76

76:                                               ; preds = %69, %68
  %77 = phi i32 [ -1, %68 ], [ %75, %69 ]
  %78 = getelementptr inbounds %"class.siscone::Ceta_phi_range", ptr %17, i32 0, i32 1
  store i32 %77, ptr %78, align 4, !tbaa !15
  br label %79

79:                                               ; preds = %76, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7siscone12phi_in_rangeEd(double noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7siscone14Ceta_phi_range12get_phi_cellEd(ptr noundef nonnull align 4 dereferenceable(8), double noundef) #2 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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" }
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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSN7siscone14Ceta_phi_rangeE", !12, i64 0, !12, i64 4}
!15 = !{!14, !12, i64 4}


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

@_ZN7siscone14Ceta_phi_range7eta_minE = external dso_local local_unnamed_addr global double, align 8
@_ZN7siscone14Ceta_phi_range7eta_maxE = external dso_local local_unnamed_addr global double, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7siscone14Ceta_phi_rangeC2Eddd(ptr noundef nonnull align 4 dereferenceable(8) %0, double noundef %1, double noundef %2, double noundef %3) unnamed_addr #0 align 2 {
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %9 = fsub double %1, %3
  store double %9, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %10 = load double, ptr @_ZN7siscone14Ceta_phi_range7eta_minE, align 8, !tbaa !5
  %11 = fadd double %10, 1.000000e-04
  store double %11, ptr %6, align 8, !tbaa !5
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %13 = load double, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %14 = fadd double %1, %3
  store double %14, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %15 = load double, ptr @_ZN7siscone14Ceta_phi_range7eta_maxE, align 8, !tbaa !5
  %16 = fadd double %15, -1.000000e-04
  store double %16, ptr %8, align 8, !tbaa !5
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %18 = load double, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  %19 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_eta_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %0, double noundef %13)
  %20 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_eta_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %0, double noundef %18)
  %factor = shl i32 %20, 1
  %21 = sub i32 %factor, %19
  store i32 %21, ptr %0, align 4, !tbaa !9
  %22 = fsub double %2, %3
  %23 = call noundef double @_ZN7siscone12phi_in_rangeEd(double noundef %22)
  %24 = fadd double %2, %3
  %25 = call noundef double @_ZN7siscone12phi_in_rangeEd(double noundef %24)
  %26 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_phi_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %0, double noundef %23)
  %27 = call noundef i32 @_ZN7siscone14Ceta_phi_range12get_phi_cellEd(ptr noundef nonnull align 4 dereferenceable(8) %0, double noundef %25)
  %28 = fcmp ogt double %25, %23
  br i1 %28, label %29, label %31

29:                                               ; preds = %4
  %factor27 = shl i32 %27, 1
  %30 = sub i32 %factor27, %26
  br label %36

31:                                               ; preds = %4
  %32 = icmp eq i32 %26, %27
  %33 = xor i32 %26, -1
  %reass.add = shl i32 %27, 1
  %34 = add i32 %reass.add, %33
  %35 = select i1 %32, i32 -1, i32 %34
  br label %36

36:                                               ; preds = %31, %29
  %.sink = phi i32 [ %30, %29 ], [ %35, %31 ]
  %37 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %.sink, ptr %37, align 4
  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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7siscone12phi_in_rangeEd(double noundef) local_unnamed_addr #2

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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" }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN7siscone14Ceta_phi_rangeE", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass