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

; 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::Creference" = type { [3 x i32] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7siscone10Creference9randomizeEv(ptr noundef nonnull align 4 dereferenceable(12) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %8 = call noundef i64 @_ZN7siscone10ranlux_getEv()
  %9 = trunc i64 %8 to i32
  store i32 %9, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %10 = call noundef i64 @_ZN7siscone10ranlux_getEv()
  %11 = trunc i64 %10 to i32
  store i32 %11, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %12 = call noundef i64 @_ZN7siscone10ranlux_getEv()
  %13 = trunc i64 %12 to i32
  store i32 %13, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %14 = call noundef i64 @_ZN7siscone10ranlux_getEv()
  %15 = trunc i64 %14 to i32
  store i32 %15, ptr %6, align 4, !tbaa !9
  %16 = load i32, ptr %3, align 4, !tbaa !9
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = and i32 %17, 16711680
  %19 = shl i32 %18, 8
  %20 = add i32 %16, %19
  %21 = getelementptr inbounds %"class.siscone::Creference", ptr %7, i32 0, i32 0
  %22 = getelementptr inbounds [3 x i32], ptr %21, i64 0, i64 0
  store i32 %20, ptr %22, align 4, !tbaa !9
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = and i32 %24, 65280
  %26 = shl i32 %25, 16
  %27 = add i32 %23, %26
  %28 = getelementptr inbounds %"class.siscone::Creference", ptr %7, i32 0, i32 0
  %29 = getelementptr inbounds [3 x i32], ptr %28, i64 0, i64 1
  store i32 %27, ptr %29, align 4, !tbaa !9
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = and i32 %31, 255
  %33 = shl i32 %32, 24
  %34 = add i32 %30, %33
  %35 = getelementptr inbounds %"class.siscone::Creference", ptr %7, i32 0, i32 0
  %36 = getelementptr inbounds [3 x i32], ptr %35, i64 0, i64 2
  store i32 %34, ptr %36, align 4, !tbaa !9
  %37 = call noundef zeroext i1 @_ZN7siscone10Creference8is_emptyEv(ptr noundef nonnull align 4 dereferenceable(12) %7)
  br i1 %37, label %38, label %39

38:                                               ; preds = %1
  call void @_ZN7siscone10Creference9randomizeEv(ptr noundef nonnull align 4 dereferenceable(12) %7)
  br label %39

39:                                               ; preds = %38, %1
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

declare noundef i64 @_ZN7siscone10ranlux_getEv() #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7siscone10Creference8is_emptyEv(ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

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 = { "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 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 #4 = { 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}


; 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 @_ZN7siscone10Creference9randomizeEv(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 4
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  br label %tailrecurse

tailrecurse:                                      ; preds = %tailrecurse, %1
  %4 = tail call noundef i64 @_ZN7siscone10ranlux_getEv()
  %5 = trunc i64 %4 to i32
  %6 = tail call noundef i64 @_ZN7siscone10ranlux_getEv()
  %7 = trunc i64 %6 to i32
  %8 = tail call noundef i64 @_ZN7siscone10ranlux_getEv()
  %9 = trunc i64 %8 to i32
  %10 = tail call noundef i64 @_ZN7siscone10ranlux_getEv()
  %11 = trunc i64 %10 to i32
  %12 = shl i32 %11, 8
  %13 = and i32 %12, -16777216
  %14 = add i32 %13, %5
  store i32 %14, ptr %0, align 4, !tbaa !5
  %15 = shl i32 %11, 16
  %16 = and i32 %15, -16777216
  %17 = add i32 %16, %7
  store i32 %17, ptr %2, align 4, !tbaa !5
  %18 = shl i32 %11, 24
  %19 = add i32 %18, %9
  store i32 %19, ptr %3, align 4, !tbaa !5
  %20 = tail call noundef zeroext i1 @_ZN7siscone10Creference8is_emptyEv(ptr noundef nonnull align 4 dereferenceable(12) %0)
  br i1 %20, label %tailrecurse, label %21

21:                                               ; preds = %tailrecurse
  ret void
}

declare noundef i64 @_ZN7siscone10ranlux_getEv() local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7siscone10Creference8is_emptyEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #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 = { "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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass