; LLVM IR from zhfkt/ComplexCi :: ComplexCi/ComplexCi.ll (ZN2ci8reinsertEPNS_7varNodeElPllPS2_)

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

%"struct.ci::FIT" = type { double, i64 }
%"struct.ci::varNode" = type { i32, i64, i64 }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ci4sortEPNS_3FITEl(ptr noundef, i64 noundef) #1

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ci16label_componentsEPNS_7varNodeEPPllS2_(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2ci24how_many_comp_would_joinElPNS_7varNodeElPPl(i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef ptr @_ZN2ci8reinsertEPNS_7varNodeElPllPS2_(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i64 %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %21 = load i64, ptr %9, align 8, !tbaa !9
  %22 = add nsw i64 %21, 1
  %23 = call noalias ptr @calloc(i64 noundef %22, i64 noundef 8) #5
  store ptr %23, ptr %17, align 8, !tbaa !5
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = add nsw i64 %24, 1
  %26 = call noalias ptr @calloc(i64 noundef %25, i64 noundef 8) #5
  store ptr %26, ptr %18, align 8, !tbaa !5
  %27 = load i64, ptr %7, align 8, !tbaa !9
  %28 = call noalias ptr @calloc(i64 noundef %27, i64 noundef 16) #5
  store ptr %28, ptr %20, align 8, !tbaa !5
  %29 = load i64, ptr %9, align 8, !tbaa !9
  %30 = icmp sle i64 %29, 1000
  br i1 %30, label %31, label %32

31:                                               ; preds = %5
  store i64 1, ptr %19, align 8, !tbaa !9
  br label %37

32:                                               ; preds = %5
  %33 = load i64, ptr %9, align 8, !tbaa !9
  %34 = sitofp i64 %33 to double
  %35 = fmul double 1.000000e-03, %34
  %36 = fptosi double %35 to i64
  store i64 %36, ptr %19, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %32, %31
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load i64, ptr %9, align 8, !tbaa !9
  %41 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZN2ci16label_componentsEPNS_7varNodeEPPllS2_(ptr noundef %38, ptr noundef %39, i64 noundef %40, ptr noundef %41)
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %68, %37
  %43 = load i64, ptr %11, align 8, !tbaa !9
  %44 = load i64, ptr %7, align 8, !tbaa !9
  %45 = icmp slt i64 %43, %44
  br i1 %45, label %46, label %71

46:                                               ; preds = %42
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = load i64, ptr %11, align 8, !tbaa !9
  %49 = getelementptr inbounds i64, ptr %47, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load i64, ptr %9, align 8, !tbaa !9
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = call noundef i64 @_ZN2ci24how_many_comp_would_joinElPNS_7varNodeElPPl(i64 noundef %50, ptr noundef %51, i64 noundef %52, ptr noundef %53)
  %55 = sitofp i64 %54 to double
  %56 = load ptr, ptr %20, align 8, !tbaa !5
  %57 = load i64, ptr %11, align 8, !tbaa !9
  %58 = getelementptr inbounds %"struct.ci::FIT", ptr %56, i64 %57
  %59 = getelementptr inbounds %"struct.ci::FIT", ptr %58, i32 0, i32 0
  store double %55, ptr %59, align 8, !tbaa !11
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load i64, ptr %11, align 8, !tbaa !9
  %62 = getelementptr inbounds i64, ptr %60, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = load ptr, ptr %20, align 8, !tbaa !5
  %65 = load i64, ptr %11, align 8, !tbaa !9
  %66 = getelementptr inbounds %"struct.ci::FIT", ptr %64, i64 %65
  %67 = getelementptr inbounds %"struct.ci::FIT", ptr %66, i32 0, i32 1
  store i64 %63, ptr %67, align 8, !tbaa !14
  br label %68

68:                                               ; preds = %46
  %69 = load i64, ptr %11, align 8, !tbaa !9
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr %11, align 8, !tbaa !9
  br label %42, !llvm.loop !15

71:                                               ; preds = %42
  %72 = load ptr, ptr %20, align 8, !tbaa !5
  %73 = load i64, ptr %7, align 8, !tbaa !9
  call void @_ZN2ci4sortEPNS_3FITEl(ptr noundef %72, i64 noundef %73)
  %74 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %74, ptr %13, align 8, !tbaa !9
  %75 = load i64, ptr %7, align 8, !tbaa !9
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %14, align 8, !tbaa !9
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %77

77:                                               ; preds = %154, %71
  %78 = load i64, ptr %13, align 8, !tbaa !9
  %79 = icmp sgt i64 %78, 0
  br i1 %79, label %80, label %155

80:                                               ; preds = %77
  %81 = load ptr, ptr %20, align 8, !tbaa !5
  %82 = load i64, ptr %16, align 8, !tbaa !9
  %83 = getelementptr inbounds %"struct.ci::FIT", ptr %81, i64 %82
  %84 = getelementptr inbounds %"struct.ci::FIT", ptr %83, i32 0, i32 1
  %85 = load i64, ptr %84, align 8, !tbaa !14
  store i64 %85, ptr %15, align 8, !tbaa !9
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load i64, ptr %15, align 8, !tbaa !9
  %88 = getelementptr inbounds %"struct.ci::varNode", ptr %86, i64 %87
  %89 = getelementptr inbounds %"struct.ci::varNode", ptr %88, i32 0, i32 0
  store i32 1, ptr %89, align 8, !tbaa !17
  %90 = load i64, ptr %16, align 8, !tbaa !9
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %16, align 8, !tbaa !9
  %92 = load i64, ptr %13, align 8, !tbaa !9
  %93 = add nsw i64 %92, -1
  store i64 %93, ptr %13, align 8, !tbaa !9
  %94 = load i64, ptr %14, align 8, !tbaa !9
  %95 = add nsw i64 %94, -1
  store i64 %95, ptr %14, align 8, !tbaa !9
  %96 = load i64, ptr %15, align 8, !tbaa !9
  %97 = load ptr, ptr %18, align 8, !tbaa !5
  %98 = load i64, ptr %14, align 8, !tbaa !9
  %99 = getelementptr inbounds i64, ptr %97, i64 %98
  store i64 %96, ptr %99, align 8, !tbaa !9
  %100 = load i64, ptr %13, align 8, !tbaa !9
  %101 = load i64, ptr %19, align 8, !tbaa !9
  %102 = srem i64 %100, %101
  %103 = icmp ne i64 %102, 0
  br i1 %103, label %154, label %104

104:                                              ; preds = %80
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = load i64, ptr %9, align 8, !tbaa !9
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZN2ci16label_componentsEPNS_7varNodeEPPllS2_(ptr noundef %105, ptr noundef %106, i64 noundef %107, ptr noundef %108)
  store i64 0, ptr %12, align 8, !tbaa !9
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %109

109:                                              ; preds = %148, %104
  %110 = load i64, ptr %11, align 8, !tbaa !9
  %111 = load i64, ptr %7, align 8, !tbaa !9
  %112 = icmp slt i64 %110, %111
  br i1 %112, label %113, label %151

113:                                              ; preds = %109
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = load i64, ptr %11, align 8, !tbaa !9
  %117 = getelementptr inbounds i64, ptr %115, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = getelementptr inbounds %"struct.ci::varNode", ptr %114, i64 %118
  %120 = getelementptr inbounds %"struct.ci::varNode", ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 8, !tbaa !17
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %147

123:                                              ; preds = %113
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load i64, ptr %11, align 8, !tbaa !9
  %126 = getelementptr inbounds i64, ptr %124, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !9
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = load i64, ptr %9, align 8, !tbaa !9
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = call noundef i64 @_ZN2ci24how_many_comp_would_joinElPNS_7varNodeElPPl(i64 noundef %127, ptr noundef %128, i64 noundef %129, ptr noundef %130)
  %132 = sitofp i64 %131 to double
  %133 = load ptr, ptr %20, align 8, !tbaa !5
  %134 = load i64, ptr %12, align 8, !tbaa !9
  %135 = getelementptr inbounds %"struct.ci::FIT", ptr %133, i64 %134
  %136 = getelementptr inbounds %"struct.ci::FIT", ptr %135, i32 0, i32 0
  store double %132, ptr %136, align 8, !tbaa !11
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = load i64, ptr %11, align 8, !tbaa !9
  %139 = getelementptr inbounds i64, ptr %137, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !9
  %141 = load ptr, ptr %20, align 8, !tbaa !5
  %142 = load i64, ptr %12, align 8, !tbaa !9
  %143 = getelementptr inbounds %"struct.ci::FIT", ptr %141, i64 %142
  %144 = getelementptr inbounds %"struct.ci::FIT", ptr %143, i32 0, i32 1
  store i64 %140, ptr %144, align 8, !tbaa !14
  %145 = load i64, ptr %12, align 8, !tbaa !9
  %146 = add nsw i64 %145, 1
  store i64 %146, ptr %12, align 8, !tbaa !9
  br label %147

147:                                              ; preds = %123, %113
  br label %148

148:                                              ; preds = %147
  %149 = load i64, ptr %11, align 8, !tbaa !9
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %11, align 8, !tbaa !9
  br label %109, !llvm.loop !20

151:                                              ; preds = %109
  %152 = load ptr, ptr %20, align 8, !tbaa !5
  %153 = load i64, ptr %13, align 8, !tbaa !9
  call void @_ZN2ci4sortEPNS_3FITEl(ptr noundef %152, i64 noundef %153)
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %154

154:                                              ; preds = %151, %80
  br label %77, !llvm.loop !21

155:                                              ; preds = %77
  %156 = load i64, ptr %7, align 8, !tbaa !9
  %157 = load ptr, ptr %18, align 8, !tbaa !5
  %158 = getelementptr inbounds i64, ptr %157, i64 0
  store i64 %156, ptr %158, align 8, !tbaa !9
  %159 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %159) #4
  %160 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %160) #4
  %161 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  ret ptr %161
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind allocsize(0,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 #3 = { 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 #4 = { nounwind }
attributes #5 = { nounwind allocsize(0,1) }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN2ci3FITE", !13, i64 0, !10, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTSN2ci7varNodeE", !19, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!"_ZTSN2ci6out_inE", !7, i64 0}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}


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

%"struct.ci::FIT" = type { double, i64 }
%"struct.ci::varNode" = type { i32, i64, i64 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ci4sortEPNS_3FITEl(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ci16label_componentsEPNS_7varNodeEPPllS2_(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2ci24how_many_comp_would_joinElPNS_7varNodeElPPl(i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noalias noundef ptr @_ZN2ci8reinsertEPNS_7varNodeElPllPS2_(ptr noundef %0, i64 noundef %1, ptr nocapture noundef readonly %2, i64 noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = add nsw i64 %3, 1
  %7 = tail call noalias ptr @calloc(i64 noundef %6, i64 noundef 8) #3
  %8 = add nsw i64 %1, 1
  %9 = tail call noalias ptr @calloc(i64 noundef %8, i64 noundef 8) #3
  %10 = tail call noalias ptr @calloc(i64 noundef %1, i64 noundef 16) #3
  %11 = icmp slt i64 %3, 1001
  %12 = uitofp nneg i64 %3 to double
  %13 = fmul double %12, 1.000000e-03
  %14 = fptosi double %13 to i64
  %.068 = select i1 %11, i64 1, i64 %14
  tail call void @_ZN2ci16label_componentsEPNS_7varNodeEPPllS2_(ptr noundef %0, ptr noundef %4, i64 noundef %3, ptr noundef %7)
  %15 = icmp sgt i64 %1, 0
  br i1 %15, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %5
  tail call void @_ZN2ci4sortEPNS_3FITEl(ptr noundef %10, i64 noundef %1)
  br label %._crit_edge88

.lr.ph:                                           ; preds = %5, %.lr.ph
  %.077 = phi i64 [ %23, %.lr.ph ], [ 0, %5 ]
  %16 = getelementptr inbounds i64, ptr %2, i64 %.077
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = tail call noundef i64 @_ZN2ci24how_many_comp_would_joinElPNS_7varNodeElPPl(i64 noundef %17, ptr noundef %0, i64 noundef %3, ptr noundef %4)
  %19 = sitofp i64 %18 to double
  %20 = getelementptr inbounds %"struct.ci::FIT", ptr %10, i64 %.077
  store double %19, ptr %20, align 8, !tbaa !9
  %21 = load i64, ptr %16, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %20, i64 8
  store i64 %21, ptr %22, align 8, !tbaa !12
  %23 = add nuw nsw i64 %.077, 1
  %exitcond.not = icmp eq i64 %23, %1
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph
  tail call void @_ZN2ci4sortEPNS_3FITEl(ptr noundef nonnull %10, i64 noundef %1)
  br i1 %15, label %.lr.ph87.split.us, label %._crit_edge88

.lr.ph87.split.us:                                ; preds = %._crit_edge, %32
  %.07185.us = phi i64 [ %28, %32 ], [ %1, %._crit_edge ]
  %.07284.us = phi i64 [ %.173.us, %32 ], [ 0, %._crit_edge ]
  %.07483.us = phi i64 [ %29, %32 ], [ %8, %._crit_edge ]
  %24 = getelementptr inbounds %"struct.ci::FIT", ptr %10, i64 %.07284.us, i32 1
  %25 = load i64, ptr %24, align 8, !tbaa !12
  %26 = getelementptr inbounds %"struct.ci::varNode", ptr %0, i64 %25
  store i32 1, ptr %26, align 8, !tbaa !15
  %27 = add nsw i64 %.07284.us, 1
  %28 = add nsw i64 %.07185.us, -1
  %29 = add nsw i64 %.07483.us, -1
  %30 = getelementptr inbounds i64, ptr %9, i64 %29
  store i64 %25, ptr %30, align 8, !tbaa !5
  %31 = srem i64 %28, %.068
  %.not.us = icmp eq i64 %31, 0
  br i1 %.not.us, label %.lr.ph81.us, label %32

.lr.ph81.us:                                      ; preds = %.lr.ph87.split.us
  tail call void @_ZN2ci16label_componentsEPNS_7varNodeEPPllS2_(ptr noundef nonnull %0, ptr noundef %4, i64 noundef %3, ptr noundef %7)
  br label %34

32:                                               ; preds = %._crit_edge82.us, %.lr.ph87.split.us
  %.173.us = phi i64 [ %27, %.lr.ph87.split.us ], [ 0, %._crit_edge82.us ]
  %33 = icmp sgt i64 %.07185.us, 1
  br i1 %33, label %.lr.ph87.split.us, label %._crit_edge88, !llvm.loop !18

34:                                               ; preds = %.lr.ph81.us, %47
  %.179.us = phi i64 [ 0, %.lr.ph81.us ], [ %48, %47 ]
  %.06978.us = phi i64 [ 0, %.lr.ph81.us ], [ %.170.us, %47 ]
  %35 = getelementptr inbounds i64, ptr %2, i64 %.179.us
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.ci::varNode", ptr %0, i64 %36
  %38 = load i32, ptr %37, align 8, !tbaa !15
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %47

40:                                               ; preds = %34
  %41 = tail call noundef i64 @_ZN2ci24how_many_comp_would_joinElPNS_7varNodeElPPl(i64 noundef %36, ptr noundef nonnull %0, i64 noundef %3, ptr noundef %4)
  %42 = sitofp i64 %41 to double
  %43 = getelementptr inbounds %"struct.ci::FIT", ptr %10, i64 %.06978.us
  store double %42, ptr %43, align 8, !tbaa !9
  %44 = load i64, ptr %35, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %43, i64 8
  store i64 %44, ptr %45, align 8, !tbaa !12
  %46 = add nsw i64 %.06978.us, 1
  br label %47

47:                                               ; preds = %40, %34
  %.170.us = phi i64 [ %46, %40 ], [ %.06978.us, %34 ]
  %48 = add nuw nsw i64 %.179.us, 1
  %exitcond89.not = icmp eq i64 %48, %1
  br i1 %exitcond89.not, label %._crit_edge82.us, label %34, !llvm.loop !19

._crit_edge82.us:                                 ; preds = %47
  tail call void @_ZN2ci4sortEPNS_3FITEl(ptr noundef %10, i64 noundef %28)
  br label %32

._crit_edge88:                                    ; preds = %32, %._crit_edge.thread, %._crit_edge
  store i64 %1, ptr %9, align 8, !tbaa !5
  tail call void @free(ptr noundef %7) #4
  tail call void @free(ptr noundef %10) #4
  ret ptr %9
}

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 nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0,1) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN2ci3FITE", !11, i64 0, !6, i64 8}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTSN2ci7varNodeE", !17, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSN2ci6out_inE", !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


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