; LLVM IR from tsotchke/quantum_geometric_tensor :: src/quantum_geometric/core (quantum_scheduler)

; 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.anon = type { i8, %struct.scheduler_config_t, ptr, i64, i64, ptr, i64, ptr, i32, i8, double }
%struct.scheduler_config_t = type { i64, i64, i8, i8, double, i32 }
%struct.scheduler_metrics_t = type { i64, i64, i64, double, double, double, i64, double }
%struct.quantum_task_t = type { ptr, i32, ptr, i64, ptr, i64, i32, ptr, double, double }
%struct.resource_pool_t = type { i32, i64, i64, double, ptr }

@scheduler = external hidden global %struct.anon, align 8

; 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: nounwind uwtable
define dso_local zeroext i1 @get_scheduler_metrics(ptr noundef %0) #1 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load i8, ptr @scheduler, align 8, !tbaa !9, !range !16, !noundef !17
  %11 = trunc i8 %10 to i1
  br i1 %11, label %12, label %15

12:                                               ; preds = %1
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %12, %1
  store i1 false, ptr %2, align 1
  br label %144

16:                                               ; preds = %12
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %17, i32 0, i32 0
  store i64 0, ptr %18, align 8, !tbaa !18
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %19, i32 0, i32 1
  store i64 0, ptr %20, align 8, !tbaa !20
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %21, i32 0, i32 2
  store i64 0, ptr %22, align 8, !tbaa !21
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %23, i32 0, i32 3
  store double 0.000000e+00, ptr %24, align 8, !tbaa !22
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %25, i32 0, i32 4
  store double 0.000000e+00, ptr %26, align 8, !tbaa !23
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %27, i32 0, i32 5
  store double 0.000000e+00, ptr %28, align 8, !tbaa !24
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %29, i32 0, i32 6
  store i64 0, ptr %30, align 8, !tbaa !25
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %31, i32 0, i32 7
  store double 0.000000e+00, ptr %32, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  store double 0.000000e+00, ptr %4, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  store double 0.000000e+00, ptr %5, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  store double 0.000000e+00, ptr %6, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  store i64 0, ptr %7, align 8, !tbaa !28
  br label %33

33:                                               ; preds = %84, %16
  %34 = load i64, ptr %7, align 8, !tbaa !28
  %35 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @scheduler, i32 0, i32 3), align 8, !tbaa !29
  %36 = icmp ult i64 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  br label %87

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %39 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @scheduler, i32 0, i32 2), align 8, !tbaa !30
  %40 = load i64, ptr %7, align 8, !tbaa !28
  %41 = getelementptr inbounds ptr, ptr %39, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  store ptr %42, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !18
  %46 = add i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !18
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.quantum_task_t, ptr %47, i32 0, i32 6
  %49 = load i32, ptr %48, align 8, !tbaa !31
  switch i32 %49, label %69 [
    i32 2, label %50
    i32 3, label %64
  ]

50:                                               ; preds = %38
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %51, i32 0, i32 1
  %53 = load i64, ptr %52, align 8, !tbaa !20
  %54 = add i64 %53, 1
  store i64 %54, ptr %52, align 8, !tbaa !20
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.quantum_task_t, ptr %55, i32 0, i32 9
  %57 = load double, ptr %56, align 8, !tbaa !33
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.quantum_task_t, ptr %58, i32 0, i32 8
  %60 = load double, ptr %59, align 8, !tbaa !34
  %61 = fsub double %57, %60
  %62 = load double, ptr %5, align 8, !tbaa !27
  %63 = fadd double %62, %61
  store double %63, ptr %5, align 8, !tbaa !27
  br label %70

64:                                               ; preds = %38
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %65, i32 0, i32 2
  %67 = load i64, ptr %66, align 8, !tbaa !21
  %68 = add i64 %67, 1
  store i64 %68, ptr %66, align 8, !tbaa !21
  br label %70

69:                                               ; preds = %38
  br label %70

70:                                               ; preds = %69, %64, %50
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.quantum_task_t, ptr %71, i32 0, i32 8
  %73 = load double, ptr %72, align 8, !tbaa !34
  %74 = fcmp ogt double %73, 0.000000e+00
  br i1 %74, label %75, label %83

75:                                               ; preds = %70
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.quantum_task_t, ptr %76, i32 0, i32 8
  %78 = load double, ptr %77, align 8, !tbaa !34
  %79 = load double, ptr getelementptr inbounds (%struct.anon, ptr @scheduler, i32 0, i32 10), align 8, !tbaa !35
  %80 = fsub double %78, %79
  %81 = load double, ptr %4, align 8, !tbaa !27
  %82 = fadd double %81, %80
  store double %82, ptr %4, align 8, !tbaa !27
  br label %83

83:                                               ; preds = %75, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %7, align 8, !tbaa !28
  %86 = add i64 %85, 1
  store i64 %86, ptr %7, align 8, !tbaa !28
  br label %33, !llvm.loop !36

87:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  store i64 0, ptr %9, align 8, !tbaa !28
  br label %88

88:                                               ; preds = %102, %87
  %89 = load i64, ptr %9, align 8, !tbaa !28
  %90 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @scheduler, i32 0, i32 6), align 8, !tbaa !38
  %91 = icmp ult i64 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  br label %105

93:                                               ; preds = %88
  %94 = load ptr, ptr getelementptr inbounds (%struct.anon, ptr @scheduler, i32 0, i32 5), align 8, !tbaa !39
  %95 = load i64, ptr %9, align 8, !tbaa !28
  %96 = getelementptr inbounds ptr, ptr %94, i64 %95
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.resource_pool_t, ptr %97, i32 0, i32 3
  %99 = load double, ptr %98, align 8, !tbaa !40
  %100 = load double, ptr %6, align 8, !tbaa !27
  %101 = fadd double %100, %99
  store double %101, ptr %6, align 8, !tbaa !27
  br label %102

102:                                              ; preds = %93
  %103 = load i64, ptr %9, align 8, !tbaa !28
  %104 = add i64 %103, 1
  store i64 %104, ptr %9, align 8, !tbaa !28
  br label %88, !llvm.loop !42

105:                                              ; preds = %92
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %106, i32 0, i32 1
  %108 = load i64, ptr %107, align 8, !tbaa !20
  %109 = icmp ugt i64 %108, 0
  br i1 %109, label %110, label %119

110:                                              ; preds = %105
  %111 = load double, ptr %5, align 8, !tbaa !27
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %112, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !20
  %115 = uitofp i64 %114 to double
  %116 = fdiv double %111, %115
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %117, i32 0, i32 4
  store double %116, ptr %118, align 8, !tbaa !23
  br label %119

119:                                              ; preds = %110, %105
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %120, i32 0, i32 0
  %122 = load i64, ptr %121, align 8, !tbaa !18
  %123 = icmp ugt i64 %122, 0
  br i1 %123, label %124, label %133

124:                                              ; preds = %119
  %125 = load double, ptr %4, align 8, !tbaa !27
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %126, i32 0, i32 0
  %128 = load i64, ptr %127, align 8, !tbaa !18
  %129 = uitofp i64 %128 to double
  %130 = fdiv double %125, %129
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %131, i32 0, i32 3
  store double %130, ptr %132, align 8, !tbaa !22
  br label %133

133:                                              ; preds = %124, %119
  %134 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @scheduler, i32 0, i32 6), align 8, !tbaa !38
  %135 = icmp ugt i64 %134, 0
  br i1 %135, label %136, label %143

136:                                              ; preds = %133
  %137 = load double, ptr %6, align 8, !tbaa !27
  %138 = load i64, ptr getelementptr inbounds (%struct.anon, ptr @scheduler, i32 0, i32 6), align 8, !tbaa !38
  %139 = uitofp i64 %138 to double
  %140 = fdiv double %137, %139
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.scheduler_metrics_t, ptr %141, i32 0, i32 5
  store double %140, ptr %142, align 8, !tbaa !24
  br label %143

143:                                              ; preds = %136, %133
  store i1 true, ptr %2, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  br label %144

144:                                              ; preds = %143, %15
  %145 = load i1, ptr %2, align 1
  ret i1 %145
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8, !6, i64 48, !13, i64 56, !13, i64 64, !6, i64 72, !13, i64 80, !6, i64 88, !15, i64 96, !11, i64 100, !14, i64 104}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !11, i64 16, !11, i64 17, !14, i64 24, !15, i64 32}
!13 = !{!"long", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !13, i64 0}
!19 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !13, i64 48, !14, i64 56}
!20 = !{!19, !13, i64 8}
!21 = !{!19, !13, i64 16}
!22 = !{!19, !14, i64 24}
!23 = !{!19, !14, i64 32}
!24 = !{!19, !14, i64 40}
!25 = !{!19, !13, i64 48}
!26 = !{!19, !14, i64 56}
!27 = !{!14, !14, i64 0}
!28 = !{!13, !13, i64 0}
!29 = !{!10, !13, i64 56}
!30 = !{!10, !6, i64 48}
!31 = !{!32, !15, i64 48}
!32 = !{!"quantum_task_t", !6, i64 0, !15, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !13, i64 40, !15, i64 48, !6, i64 56, !14, i64 64, !14, i64 72}
!33 = !{!32, !14, i64 72}
!34 = !{!32, !14, i64 64}
!35 = !{!10, !14, i64 104}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!10, !13, i64 80}
!39 = !{!10, !6, i64 72}
!40 = !{!41, !14, i64 24}
!41 = !{!"", !15, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !6, i64 32}
!42 = distinct !{!42, !37}


; 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.anon = type { i8, %struct.scheduler_config_t, ptr, i64, i64, ptr, i64, ptr, i32, i8, double }
%struct.scheduler_config_t = type { i64, i64, i8, i8, double, i32 }

@scheduler = external hidden local_unnamed_addr global %struct.anon, align 8

; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local noundef zeroext i1 @get_scheduler_metrics(ptr noundef writeonly %0) local_unnamed_addr #0 {
  %2 = load i8, ptr @scheduler, align 8, !tbaa !5, !range !15, !noundef !16
  %3 = trunc nuw i8 %2 to i1
  %4 = icmp ne ptr %0, null
  %or.cond = and i1 %4, %3
  br i1 %or.cond, label %5, label %89

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %0, i8 0, i64 64, i1 false)
  %11 = load i64, ptr getelementptr inbounds (i8, ptr @scheduler, i64 56), align 8, !tbaa !17
  %.not59 = icmp eq i64 %11, 0
  br i1 %.not59, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %12 = load ptr, ptr getelementptr inbounds (i8, ptr @scheduler, i64 48), align 8, !tbaa !18
  br label %18

.preheader:                                       ; preds = %37, %5
  %13 = phi i64 [ 0, %5 ], [ %24, %37 ]
  %14 = phi i64 [ 0, %5 ], [ %38, %37 ]
  %.041.lcssa = phi double [ 0.000000e+00, %5 ], [ %.142, %37 ]
  %.040.lcssa = phi double [ 0.000000e+00, %5 ], [ %.1, %37 ]
  %15 = load i64, ptr getelementptr inbounds (i8, ptr @scheduler, i64 80), align 8, !tbaa !19
  %.not60 = icmp eq i64 %15, 0
  br i1 %.not60, label %._crit_edge, label %.lr.ph56

.lr.ph56:                                         ; preds = %.preheader
  %16 = load ptr, ptr getelementptr inbounds (i8, ptr @scheduler, i64 72), align 8, !tbaa !20
  %xtraiter = and i64 %15, 3
  %17 = icmp ult i64 %15, 4
  br i1 %17, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph56.new

.lr.ph56.new:                                     ; preds = %.lr.ph56
  %unroll_iter = and i64 %15, -4
  br label %53

18:                                               ; preds = %.lr.ph, %37
  %19 = phi i64 [ 0, %.lr.ph ], [ %38, %37 ]
  %20 = phi i64 [ 0, %.lr.ph ], [ %39, %37 ]
  %21 = phi i64 [ 0, %.lr.ph ], [ %24, %37 ]
  %.03852 = phi i64 [ 0, %.lr.ph ], [ %46, %37 ]
  %.04051 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1, %37 ]
  %.04150 = phi double [ 0.000000e+00, %.lr.ph ], [ %.142, %37 ]
  %22 = getelementptr inbounds ptr, ptr %12, i64 %.03852
  %23 = load ptr, ptr %22, align 8, !tbaa !21
  %24 = add i64 %21, 1
  store i64 %24, ptr %0, align 8, !tbaa !22
  %25 = getelementptr inbounds i8, ptr %23, i64 48
  %26 = load i32, ptr %25, align 8, !tbaa !24
  switch i32 %26, label %37 [
    i32 2, label %27
    i32 3, label %35
  ]

27:                                               ; preds = %18
  %28 = add i64 %19, 1
  store i64 %28, ptr %6, align 8, !tbaa !26
  %29 = getelementptr inbounds i8, ptr %23, i64 72
  %30 = load double, ptr %29, align 8, !tbaa !27
  %31 = getelementptr inbounds i8, ptr %23, i64 64
  %32 = load double, ptr %31, align 8, !tbaa !28
  %33 = fsub double %30, %32
  %34 = fadd double %.04051, %33
  br label %37

35:                                               ; preds = %18
  %36 = add i64 %20, 1
  store i64 %36, ptr %7, align 8, !tbaa !29
  br label %37

37:                                               ; preds = %18, %35, %27
  %38 = phi i64 [ %19, %18 ], [ %19, %35 ], [ %28, %27 ]
  %39 = phi i64 [ %20, %18 ], [ %36, %35 ], [ %20, %27 ]
  %.1 = phi double [ %.04051, %18 ], [ %.04051, %35 ], [ %34, %27 ]
  %40 = getelementptr inbounds i8, ptr %23, i64 64
  %41 = load double, ptr %40, align 8, !tbaa !28
  %42 = fcmp ogt double %41, 0.000000e+00
  %43 = load double, ptr getelementptr inbounds (i8, ptr @scheduler, i64 104), align 8
  %44 = fsub double %41, %43
  %45 = fadd double %.04150, %44
  %.142 = select i1 %42, double %45, double %.04150
  %46 = add nuw i64 %.03852, 1
  %exitcond.not = icmp eq i64 %46, %11
  br i1 %exitcond.not, label %.preheader, label %18, !llvm.loop !30

._crit_edge.loopexit.unr-lcssa:                   ; preds = %53, %.lr.ph56
  %.lcssa.ph = phi double [ poison, %.lr.ph56 ], [ %76, %53 ]
  %.055.unr = phi i64 [ 0, %.lr.ph56 ], [ %77, %53 ]
  %.03954.unr = phi double [ 0.000000e+00, %.lr.ph56 ], [ %76, %53 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %.055.epil = phi i64 [ %52, %.epil.preheader ], [ %.055.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.03954.epil = phi double [ %51, %.epil.preheader ], [ %.03954.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %47 = getelementptr inbounds ptr, ptr %16, i64 %.055.epil
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = getelementptr inbounds i8, ptr %48, i64 24
  %50 = load double, ptr %49, align 8, !tbaa !32
  %51 = fadd double %.03954.epil, %50
  %52 = add nuw i64 %.055.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !34

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %.preheader
  %.039.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %51, %.epil.preheader ]
  %.not = icmp eq i64 %14, 0
  br i1 %.not, label %81, label %78

53:                                               ; preds = %53, %.lr.ph56.new
  %.055 = phi i64 [ 0, %.lr.ph56.new ], [ %77, %53 ]
  %.03954 = phi double [ 0.000000e+00, %.lr.ph56.new ], [ %76, %53 ]
  %niter = phi i64 [ 0, %.lr.ph56.new ], [ %niter.next.3, %53 ]
  %54 = getelementptr inbounds ptr, ptr %16, i64 %.055
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  %56 = getelementptr inbounds i8, ptr %55, i64 24
  %57 = load double, ptr %56, align 8, !tbaa !32
  %58 = fadd double %.03954, %57
  %59 = or disjoint i64 %.055, 1
  %60 = getelementptr inbounds ptr, ptr %16, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !21
  %62 = getelementptr inbounds i8, ptr %61, i64 24
  %63 = load double, ptr %62, align 8, !tbaa !32
  %64 = fadd double %58, %63
  %65 = or disjoint i64 %.055, 2
  %66 = getelementptr inbounds ptr, ptr %16, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !21
  %68 = getelementptr inbounds i8, ptr %67, i64 24
  %69 = load double, ptr %68, align 8, !tbaa !32
  %70 = fadd double %64, %69
  %71 = or disjoint i64 %.055, 3
  %72 = getelementptr inbounds ptr, ptr %16, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !21
  %74 = getelementptr inbounds i8, ptr %73, i64 24
  %75 = load double, ptr %74, align 8, !tbaa !32
  %76 = fadd double %70, %75
  %77 = add nuw i64 %.055, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %53, !llvm.loop !36

78:                                               ; preds = %._crit_edge
  %79 = uitofp i64 %14 to double
  %80 = fdiv double %.040.lcssa, %79
  store double %80, ptr %9, align 8, !tbaa !37
  br label %81

81:                                               ; preds = %78, %._crit_edge
  %.not48 = icmp eq i64 %13, 0
  br i1 %.not48, label %85, label %82

82:                                               ; preds = %81
  %83 = uitofp i64 %13 to double
  %84 = fdiv double %.041.lcssa, %83
  store double %84, ptr %8, align 8, !tbaa !38
  br label %85

85:                                               ; preds = %82, %81
  br i1 %.not60, label %89, label %86

86:                                               ; preds = %85
  %87 = uitofp i64 %15 to double
  %88 = fdiv double %.039.lcssa, %87
  store double %88, ptr %10, align 8, !tbaa !39
  br label %89

89:                                               ; preds = %85, %86, %1
  ret i1 %or.cond
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) 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 nounwind willreturn memory(argmem: write) }

!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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !14, i64 48, !11, i64 56, !11, i64 64, !14, i64 72, !11, i64 80, !14, i64 88, !13, i64 96, !7, i64 100, !12, i64 104}
!7 = !{!"_Bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 17, !12, i64 24, !13, i64 32}
!11 = !{!"long", !8, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!6, !11, i64 56}
!18 = !{!6, !14, i64 48}
!19 = !{!6, !11, i64 80}
!20 = !{!6, !14, i64 72}
!21 = !{!14, !14, i64 0}
!22 = !{!23, !11, i64 0}
!23 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !11, i64 48, !12, i64 56}
!24 = !{!25, !13, i64 48}
!25 = !{!"quantum_task_t", !14, i64 0, !13, i64 8, !14, i64 16, !11, i64 24, !14, i64 32, !11, i64 40, !13, i64 48, !14, i64 56, !12, i64 64, !12, i64 72}
!26 = !{!23, !11, i64 8}
!27 = !{!25, !12, i64 72}
!28 = !{!25, !12, i64 64}
!29 = !{!23, !11, i64 16}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!33, !12, i64 24}
!33 = !{!"", !13, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !14, i64 32}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.unroll.disable"}
!36 = distinct !{!36, !31}
!37 = !{!23, !12, i64 32}
!38 = !{!23, !12, i64 24}
!39 = !{!23, !12, i64 40}


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