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

; 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::Cquadtree" = type <{ double, double, double, double, ptr, [2 x [2 x ptr]], i8, [7 x i8] }>

@.str = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8
  %7 = load ptr, ptr %5, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  store i32 1, ptr %3, align 4
  br label %79

10:                                               ; preds = %2
  %11 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 6
  %12 = load i8, ptr %11, align 8, !tbaa !9, !range !13, !noundef !14
  %13 = trunc i8 %12 to i1
  br i1 %13, label %14, label %67

14:                                               ; preds = %10
  %15 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %16 = getelementptr inbounds [2 x [2 x ptr]], ptr %15, i64 0, i64 0
  %17 = getelementptr inbounds [2 x ptr], ptr %16, i64 0, i64 0
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %27

20:                                               ; preds = %14
  %21 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %22 = getelementptr inbounds [2 x [2 x ptr]], ptr %21, i64 0, i64 0
  %23 = getelementptr inbounds [2 x ptr], ptr %22, i64 0, i64 0
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %24, ptr noundef %25)
  br label %27

27:                                               ; preds = %20, %14
  %28 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %29 = getelementptr inbounds [2 x [2 x ptr]], ptr %28, i64 0, i64 0
  %30 = getelementptr inbounds [2 x ptr], ptr %29, i64 0, i64 1
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %40

33:                                               ; preds = %27
  %34 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %35 = getelementptr inbounds [2 x [2 x ptr]], ptr %34, i64 0, i64 0
  %36 = getelementptr inbounds [2 x ptr], ptr %35, i64 0, i64 1
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %37, ptr noundef %38)
  br label %40

40:                                               ; preds = %33, %27
  %41 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %42 = getelementptr inbounds [2 x [2 x ptr]], ptr %41, i64 0, i64 1
  %43 = getelementptr inbounds [2 x ptr], ptr %42, i64 0, i64 0
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %53

46:                                               ; preds = %40
  %47 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %48 = getelementptr inbounds [2 x [2 x ptr]], ptr %47, i64 0, i64 1
  %49 = getelementptr inbounds [2 x ptr], ptr %48, i64 0, i64 0
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %50, ptr noundef %51)
  br label %53

53:                                               ; preds = %46, %40
  %54 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %55 = getelementptr inbounds [2 x [2 x ptr]], ptr %54, i64 0, i64 1
  %56 = getelementptr inbounds [2 x ptr], ptr %55, i64 0, i64 1
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %66

59:                                               ; preds = %53
  %60 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %61 = getelementptr inbounds [2 x [2 x ptr]], ptr %60, i64 0, i64 1
  %62 = getelementptr inbounds [2 x ptr], ptr %61, i64 0, i64 1
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %63, ptr noundef %64)
  br label %66

66:                                               ; preds = %59, %53
  br label %78

67:                                               ; preds = %10
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 0
  %70 = load double, ptr %69, align 8, !tbaa !15
  %71 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 1
  %72 = load double, ptr %71, align 8, !tbaa !16
  %73 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 2
  %74 = load double, ptr %73, align 8, !tbaa !17
  %75 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 3
  %76 = load double, ptr %75, align 8, !tbaa !18
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str, double noundef %70, double noundef %72, double noundef %74, double noundef %76) #2
  br label %78

78:                                               ; preds = %67, %66
  store i32 0, ptr %3, align 4
  br label %79

79:                                               ; preds = %78, %9
  %80 = load i32, ptr %3, align 4
  ret i32 %80
}

attributes #0 = { 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 #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 = { 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, !12, i64 72}
!10 = !{!"_ZTSN7siscone9CquadtreeE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !7, i64 40, !12, i64 72}
!11 = !{!"double", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!10, !11, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!10, !11, i64 16}
!18 = !{!10, !11, i64 24}


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

@.str = external hidden unnamed_addr constant [17 x i8], align 1

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

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(73) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = icmp eq ptr %1, null
  br i1 %3, label %.loopexit, label %.lr.ph.split

.lr.ph.split:                                     ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 72
  %5 = load i8, ptr %4, align 8, !tbaa !5, !range !12, !noundef !13
  %6 = trunc nuw i8 %5 to i1
  br i1 %6, label %.lr.ph41.preheader, label %.split

.lr.ph41.preheader:                               ; preds = %.lr.ph.split
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  %.not.peel = icmp eq ptr %8, null
  br i1 %.not.peel, label %11, label %9

9:                                                ; preds = %.lr.ph41.preheader
  %10 = tail call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %8, ptr noundef nonnull %1)
  br label %11

11:                                               ; preds = %9, %.lr.ph41.preheader
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %.not12.peel = icmp eq ptr %13, null
  br i1 %.not12.peel, label %16, label %14

14:                                               ; preds = %11
  %15 = tail call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %13, ptr noundef nonnull %1)
  br label %16

16:                                               ; preds = %14, %11
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %.not13.peel = icmp eq ptr %18, null
  br i1 %.not13.peel, label %21, label %19

19:                                               ; preds = %16
  %20 = tail call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %18, ptr noundef nonnull %1)
  br label %21

21:                                               ; preds = %19, %16
  %22 = getelementptr inbounds i8, ptr %0, i64 64
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  %.not14.peel.not = icmp eq ptr %23, null
  br i1 %.not14.peel.not, label %.loopexit, label %tailrecurse.peel

tailrecurse.peel:                                 ; preds = %21
  %24 = getelementptr inbounds i8, ptr %23, i64 72
  %25 = load i8, ptr %24, align 8, !tbaa !5, !range !12, !noundef !13
  %26 = trunc nuw i8 %25 to i1
  br i1 %26, label %.lr.ph41, label %.split

.lr.ph41:                                         ; preds = %tailrecurse.peel, %tailrecurse
  %.tr2240 = phi ptr [ %43, %tailrecurse ], [ %23, %tailrecurse.peel ]
  %27 = getelementptr inbounds i8, ptr %.tr2240, i64 40
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  %.not = icmp eq ptr %28, null
  br i1 %.not, label %31, label %29

29:                                               ; preds = %.lr.ph41
  %30 = tail call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %28, ptr noundef nonnull %1)
  br label %31

31:                                               ; preds = %29, %.lr.ph41
  %32 = getelementptr inbounds i8, ptr %.tr2240, i64 48
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  %.not12 = icmp eq ptr %33, null
  br i1 %.not12, label %36, label %34

34:                                               ; preds = %31
  %35 = tail call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %33, ptr noundef nonnull %1)
  br label %36

36:                                               ; preds = %34, %31
  %37 = getelementptr inbounds i8, ptr %.tr2240, i64 56
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  %.not13 = icmp eq ptr %38, null
  br i1 %.not13, label %41, label %39

39:                                               ; preds = %36
  %40 = tail call noundef i32 @_ZN7siscone9Cquadtree11save_leavesEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %38, ptr noundef nonnull %1)
  br label %41

41:                                               ; preds = %39, %36
  %42 = getelementptr inbounds i8, ptr %.tr2240, i64 64
  %43 = load ptr, ptr %42, align 8, !tbaa !14
  %.not14 = icmp eq ptr %43, null
  br i1 %.not14, label %.loopexit, label %tailrecurse

tailrecurse:                                      ; preds = %41
  %44 = getelementptr inbounds i8, ptr %43, i64 72
  %45 = load i8, ptr %44, align 8, !tbaa !5, !range !12, !noundef !13
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %.lr.ph41, label %.split, !llvm.loop !15

.split:                                           ; preds = %tailrecurse, %tailrecurse.peel, %.lr.ph.split
  %.tr.lcssa21 = phi ptr [ %0, %.lr.ph.split ], [ %23, %tailrecurse.peel ], [ %43, %tailrecurse ]
  %47 = load double, ptr %.tr.lcssa21, align 8, !tbaa !17
  %48 = getelementptr inbounds i8, ptr %.tr.lcssa21, i64 8
  %49 = load double, ptr %48, align 8, !tbaa !18
  %50 = getelementptr inbounds i8, ptr %.tr.lcssa21, i64 16
  %51 = load double, ptr %50, align 8, !tbaa !19
  %52 = getelementptr inbounds i8, ptr %.tr.lcssa21, i64 24
  %53 = load double, ptr %52, align 8, !tbaa !20
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %1, ptr noundef nonnull @.str, double noundef %47, double noundef %49, double noundef %51, double noundef %53) #2
  br label %.loopexit

.loopexit:                                        ; preds = %41, %21, %2, %.split
  %ret.known.tr18 = phi i32 [ 0, %.split ], [ 1, %2 ], [ 0, %21 ], [ 0, %41 ]
  ret i32 %ret.known.tr18
}

attributes #0 = { 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 #1 = { mustprogress nofree 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 #2 = { 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, !11, i64 72}
!6 = !{!"_ZTSN7siscone9CquadtreeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !8, i64 40, !11, i64 72}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}
!17 = !{!6, !7, i64 0}
!18 = !{!6, !7, i64 8}
!19 = !{!6, !7, i64 16}
!20 = !{!6, !7, i64 24}


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