; LLVM IR from mickypaganini/SSI2016-jet-clustering :: spartyjet-4.0.2_mac/External/fastjet-3.0.0/plugins/SISCone/siscone/siscone/qua_5013e7e8 (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: mustprogress uwtable
define dso_local noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %0, ptr noundef %1) #0 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 %50

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 %49

14:                                               ; preds = %10
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 0
  %17 = load double, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 1
  %19 = load double, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 2
  %21 = load double, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 3
  %23 = load double, ptr %22, align 8, !tbaa !18
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef @.str, double noundef %17, double noundef %19, double noundef %21, double noundef %23) #2
  %25 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %26 = getelementptr inbounds [2 x [2 x ptr]], ptr %25, i64 0, i64 0
  %27 = getelementptr inbounds [2 x ptr], ptr %26, i64 0, i64 0
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %28, ptr noundef %29)
  %31 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %32 = getelementptr inbounds [2 x [2 x ptr]], ptr %31, i64 0, i64 0
  %33 = getelementptr inbounds [2 x ptr], ptr %32, i64 0, i64 1
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = call noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %34, ptr noundef %35)
  %37 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %38 = getelementptr inbounds [2 x [2 x ptr]], ptr %37, i64 0, i64 1
  %39 = getelementptr inbounds [2 x ptr], ptr %38, i64 0, i64 0
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %40, ptr noundef %41)
  %43 = getelementptr inbounds %"class.siscone::Cquadtree", ptr %6, i32 0, i32 5
  %44 = getelementptr inbounds [2 x [2 x ptr]], ptr %43, i64 0, i64 1
  %45 = getelementptr inbounds [2 x ptr], ptr %44, i64 0, i64 1
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %46, ptr noundef %47)
  br label %49

49:                                               ; preds = %14, %10
  store i32 0, ptr %3, align 4
  br label %50

50:                                               ; preds = %49, %9
  %51 = load i32, ptr %3, align 4
  ret i32 %51
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #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 = { 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 #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: mustprogress nofree nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(73) %0, ptr noundef %1) local_unnamed_addr #0 align 2 {
  %3 = icmp eq ptr %1, null
  br i1 %3, label %._crit_edge, 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 %tailrecurse, label %._crit_edge

tailrecurse:                                      ; preds = %.lr.ph.split, %tailrecurse
  %.tr1025 = phi ptr [ %25, %tailrecurse ], [ %0, %.lr.ph.split ]
  %7 = load double, ptr %.tr1025, align 8, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %.tr1025, i64 8
  %9 = load double, ptr %8, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %.tr1025, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %.tr1025, i64 24
  %13 = load double, ptr %12, align 8, !tbaa !17
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %1, ptr noundef nonnull @.str, double noundef %7, double noundef %9, double noundef %11, double noundef %13) #2
  %15 = getelementptr inbounds i8, ptr %.tr1025, i64 40
  %16 = load ptr, ptr %15, align 8, !tbaa !18
  %17 = tail call noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %16, ptr noundef nonnull %1)
  %18 = getelementptr inbounds i8, ptr %.tr1025, i64 48
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  %20 = tail call noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %19, ptr noundef nonnull %1)
  %21 = getelementptr inbounds i8, ptr %.tr1025, i64 56
  %22 = load ptr, ptr %21, align 8, !tbaa !18
  %23 = tail call noundef i32 @_ZN7siscone9Cquadtree4saveEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(73) %22, ptr noundef nonnull %1)
  %24 = getelementptr inbounds i8, ptr %.tr1025, i64 64
  %25 = load ptr, ptr %24, align 8, !tbaa !18
  %26 = getelementptr inbounds i8, ptr %25, i64 72
  %27 = load i8, ptr %26, align 8, !tbaa !5, !range !12, !noundef !13
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %tailrecurse, label %._crit_edge

._crit_edge:                                      ; preds = %tailrecurse, %.lr.ph.split, %2
  %ret.known.tr.lcssa = phi i32 [ 1, %2 ], [ 0, %.lr.ph.split ], [ 0, %tailrecurse ]
  ret i32 %ret.known.tr.lcssa
}

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

attributes #0 = { 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 #1 = { 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 #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 = !{!6, !7, i64 0}
!15 = !{!6, !7, i64 8}
!16 = !{!6, !7, i64 16}
!17 = !{!6, !7, i64 24}
!18 = !{!10, !10, i64 0}


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