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

; 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.ComplexFloat = type { float, float }
%struct.quantum_geometric_metric_t = type { i32, i64, ptr, i8, ptr, i32 }
%struct.quantum_state_t = type { i32, i64, i64, ptr, ptr, ptr, ptr, i8, i32 }

@COMPLEX_FLOAT_ONE = external hidden constant %struct.ComplexFloat, align 4
@COMPLEX_FLOAT_ZERO = external hidden constant %struct.ComplexFloat, align 4

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; 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 i32 @geometric_compute_metric(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %struct.ComplexFloat, align 4
  %15 = alloca %struct.ComplexFloat, align 4
  %16 = alloca i64, align 8
  %17 = alloca %struct.ComplexFloat, align 4
  %18 = alloca %struct.ComplexFloat, align 4
  %19 = alloca %struct.ComplexFloat, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %2
  store i32 -1, ptr %3, align 4
  br label %161

23:                                               ; preds = %2
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  store i32 -1, ptr %3, align 4
  br label %161

27:                                               ; preds = %23
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.quantum_geometric_metric_t, ptr %28, i32 0, i32 1
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.quantum_state_t, ptr %31, i32 0, i32 1
  %33 = load i64, ptr %32, align 8, !tbaa !14
  %34 = icmp ne i64 %30, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %27
  store i32 -1, ptr %3, align 4
  br label %161

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.quantum_state_t, ptr %37, i32 0, i32 1
  %39 = load i64, ptr %38, align 8, !tbaa !14
  store i64 %39, ptr %6, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 32, ptr %7, align 8, !tbaa !16
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.quantum_geometric_metric_t, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !17
  switch i32 %42, label %158 [
    i32 0, label %159
    i32 2, label %43
  ]

43:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !16
  br label %44

44:                                               ; preds = %154, %43
  %45 = load i64, ptr %8, align 8, !tbaa !16
  %46 = load i64, ptr %6, align 8, !tbaa !16
  %47 = icmp ult i64 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 3, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %157

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !16
  br label %50

50:                                               ; preds = %150, %49
  %51 = load i64, ptr %10, align 8, !tbaa !16
  %52 = load i64, ptr %6, align 8, !tbaa !16
  %53 = icmp ult i64 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 6, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %153

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %56 = load i64, ptr %8, align 8, !tbaa !16
  %57 = add i64 %56, 32
  %58 = load i64, ptr %6, align 8, !tbaa !16
  %59 = icmp ult i64 %57, %58
  br i1 %59, label %60, label %63

60:                                               ; preds = %55
  %61 = load i64, ptr %8, align 8, !tbaa !16
  %62 = add i64 %61, 32
  br label %65

63:                                               ; preds = %55
  %64 = load i64, ptr %6, align 8, !tbaa !16
  br label %65

65:                                               ; preds = %63, %60
  %66 = phi i64 [ %62, %60 ], [ %64, %63 ]
  store i64 %66, ptr %11, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %67 = load i64, ptr %10, align 8, !tbaa !16
  %68 = add i64 %67, 32
  %69 = load i64, ptr %6, align 8, !tbaa !16
  %70 = icmp ult i64 %68, %69
  br i1 %70, label %71, label %74

71:                                               ; preds = %65
  %72 = load i64, ptr %10, align 8, !tbaa !16
  %73 = add i64 %72, 32
  br label %76

74:                                               ; preds = %65
  %75 = load i64, ptr %6, align 8, !tbaa !16
  br label %76

76:                                               ; preds = %74, %71
  %77 = phi i64 [ %73, %71 ], [ %75, %74 ]
  store i64 %77, ptr %12, align 8, !tbaa !16
  %78 = load i64, ptr %8, align 8, !tbaa !16
  %79 = add i64 %78, 32
  %80 = load i64, ptr %6, align 8, !tbaa !16
  %81 = icmp ult i64 %79, %80
  br i1 %81, label %82, label %89

82:                                               ; preds = %76
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.quantum_state_t, ptr %83, i32 0, i32 3
  %85 = load ptr, ptr %84, align 8, !tbaa !18
  %86 = load i64, ptr %8, align 8, !tbaa !16
  %87 = add i64 %86, 32
  %88 = getelementptr inbounds %struct.ComplexFloat, ptr %85, i64 %87
  call void @llvm.prefetch.p0(ptr %88, i32 0, i32 3, i32 1)
  br label %89

89:                                               ; preds = %82, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %90 = load i64, ptr %8, align 8, !tbaa !16
  store i64 %90, ptr %13, align 8, !tbaa !16
  br label %91

91:                                               ; preds = %146, %89
  %92 = load i64, ptr %13, align 8, !tbaa !16
  %93 = load i64, ptr %11, align 8, !tbaa !16
  %94 = icmp ult i64 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 9, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %149

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.quantum_state_t, ptr %97, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !18
  %100 = load i64, ptr %13, align 8, !tbaa !16
  %101 = getelementptr inbounds %struct.ComplexFloat, ptr %99, i64 %100
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %101, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %102 = load <2 x float>, ptr %14, align 4
  %103 = call <2 x float> @complex_float_conjugate(<2 x float> %102)
  store <2 x float> %103, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %104 = load i64, ptr %10, align 8, !tbaa !16
  %105 = load i64, ptr %12, align 8, !tbaa !16
  %106 = load i64, ptr %10, align 8, !tbaa !16
  %107 = sub i64 %105, %106
  %108 = and i64 %107, -8
  %109 = add i64 %104, %108
  store i64 %109, ptr %16, align 8, !tbaa !16
  br label %110

110:                                              ; preds = %142, %96
  %111 = load i64, ptr %16, align 8, !tbaa !16
  %112 = load i64, ptr %12, align 8, !tbaa !16
  %113 = icmp ult i64 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  store i32 12, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %145

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.quantum_state_t, ptr %116, i32 0, i32 3
  %118 = load ptr, ptr %117, align 8, !tbaa !18
  %119 = load i64, ptr %16, align 8, !tbaa !16
  %120 = getelementptr inbounds %struct.ComplexFloat, ptr %118, i64 %119
  %121 = load <2 x float>, ptr %15, align 4
  %122 = load <2 x float>, ptr %120, align 4
  %123 = call <2 x float> @complex_float_multiply(<2 x float> %121, <2 x float> %122)
  store <2 x float> %123, ptr %17, align 4
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.quantum_geometric_metric_t, ptr %124, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !22
  %127 = load i64, ptr %13, align 8, !tbaa !16
  %128 = load i64, ptr %6, align 8, !tbaa !16
  %129 = mul i64 %127, %128
  %130 = load i64, ptr %16, align 8, !tbaa !16
  %131 = add i64 %129, %130
  %132 = getelementptr inbounds %struct.ComplexFloat, ptr %126, i64 %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %133 = load i64, ptr %13, align 8, !tbaa !16
  %134 = load i64, ptr %16, align 8, !tbaa !16
  %135 = icmp eq i64 %133, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %115
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 @COMPLEX_FLOAT_ONE, i64 8, i1 false), !tbaa.struct !19
  br label %138

137:                                              ; preds = %115
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 @COMPLEX_FLOAT_ZERO, i64 8, i1 false), !tbaa.struct !19
  br label %138

138:                                              ; preds = %137, %136
  %139 = load <2 x float>, ptr %19, align 4
  %140 = load <2 x float>, ptr %17, align 4
  %141 = call <2 x float> @complex_float_subtract(<2 x float> %139, <2 x float> %140)
  store <2 x float> %141, ptr %18, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %132, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %142

142:                                              ; preds = %138
  %143 = load i64, ptr %16, align 8, !tbaa !16
  %144 = add i64 %143, 1
  store i64 %144, ptr %16, align 8, !tbaa !16
  br label %110, !llvm.loop !23

145:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %146

146:                                              ; preds = %145
  %147 = load i64, ptr %13, align 8, !tbaa !16
  %148 = add i64 %147, 1
  store i64 %148, ptr %13, align 8, !tbaa !16
  br label %91, !llvm.loop !25

149:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %150

150:                                              ; preds = %149
  %151 = load i64, ptr %10, align 8, !tbaa !16
  %152 = add i64 %151, 32
  store i64 %152, ptr %10, align 8, !tbaa !16
  br label %50, !llvm.loop !26

153:                                              ; preds = %54
  br label %154

154:                                              ; preds = %153
  %155 = load i64, ptr %8, align 8, !tbaa !16
  %156 = add i64 %155, 32
  store i64 %156, ptr %8, align 8, !tbaa !16
  br label %44, !llvm.loop !27

157:                                              ; preds = %48
  br label %159

158:                                              ; preds = %36
  store i32 -7, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %160

159:                                              ; preds = %157, %36
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %160

160:                                              ; preds = %159, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %161

161:                                              ; preds = %160, %35, %26, %22
  %162 = load i32, ptr %3, align 4
  ret i32 %162
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @llvm.prefetch.p0(ptr nocapture readonly, i32 immarg, i32 immarg, i32 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @complex_float_conjugate(<2 x float>) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @complex_float_multiply(<2 x float>, <2 x float>) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @complex_float_subtract(<2 x float>, <2 x float>) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "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 #5 = { 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, !12, i64 8}
!10 = !{!"quantum_geometric_metric_t", !11, i64 0, !12, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !11, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!15, !12, i64 8}
!15 = !{!"quantum_state_t", !11, i64 0, !12, i64 8, !12, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !11, i64 60}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !11, i64 0}
!18 = !{!15, !6, i64 24}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !20}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!10, !6, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !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"

%struct.ComplexFloat = type { float, float }

@COMPLEX_FLOAT_ONE = external hidden local_unnamed_addr constant %struct.ComplexFloat, align 4
@COMPLEX_FLOAT_ZERO = external hidden local_unnamed_addr constant %struct.ComplexFloat, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i32 -7, 1) i32 @geometric_compute_metric(ptr noundef readonly %0, ptr noundef readonly %1) local_unnamed_addr #0 {
  %3 = icmp eq ptr %0, null
  %4 = icmp eq ptr %1, null
  %or.cond = or i1 %3, %4
  br i1 %or.cond, label %55, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load i64, ptr %8, align 8, !tbaa !13
  %.not = icmp eq i64 %7, %9
  br i1 %.not, label %10, label %55

10:                                               ; preds = %5
  %11 = load i32, ptr %0, align 8, !tbaa !15
  switch i32 %11, label %55 [
    i32 0, label %.loopexit58
    i32 2, label %.preheader57
  ]

.preheader57:                                     ; preds = %10
  %.not71 = icmp eq i64 %7, 0
  br i1 %.not71, label %.loopexit58, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader57
  %12 = getelementptr inbounds i8, ptr %1, i64 24
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %COMPLEX_FLOAT_ONE.val = load <2 x float>, ptr @COMPLEX_FLOAT_ONE, align 4
  %COMPLEX_FLOAT_ZERO.val = load <2 x float>, ptr @COMPLEX_FLOAT_ZERO, align 4
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %.split.us
  %.04970 = phi i64 [ 0, %.preheader.lr.ph ], [ %14, %.split.us ]
  %14 = add i64 %.04970, 32
  %15 = icmp ult i64 %14, %7
  %16 = tail call i64 @llvm.umin.i64(i64 %14, i64 %7)
  %17 = icmp ult i64 %.04970, %16
  br i1 %17, label %.preheader.split.us, label %.preheader.split

.preheader.split.us:                              ; preds = %.preheader, %..loopexit_crit_edge.us
  %.05163.us = phi i64 [ %18, %..loopexit_crit_edge.us ], [ 0, %.preheader ]
  %18 = add i64 %.05163.us, 32
  %19 = tail call i64 @llvm.umin.i64(i64 %18, i64 %7)
  br i1 %15, label %20, label %.lr.ph62.us

20:                                               ; preds = %.preheader.split.us
  %21 = load ptr, ptr %12, align 8, !tbaa !16
  %22 = getelementptr inbounds %struct.ComplexFloat, ptr %21, i64 %14
  tail call void @llvm.prefetch.p0(ptr %22, i32 0, i32 3, i32 1)
  br label %.lr.ph62.us

.lr.ph62.us:                                      ; preds = %20, %.preheader.split.us
  %23 = sub i64 %19, %.05163.us
  %24 = and i64 %23, -8
  %25 = add i64 %24, %.05163.us
  %26 = icmp ult i64 %25, %19
  %.fr.us = freeze i1 %26
  br i1 %.fr.us, label %.lr.ph.us.us, label %.lr.ph62.split.us67

.lr.ph62.split.us67:                              ; preds = %.lr.ph62.us, %.lr.ph62.split.us67
  %.05260.us64 = phi i64 [ %30, %.lr.ph62.split.us67 ], [ %.04970, %.lr.ph62.us ]
  %27 = load ptr, ptr %12, align 8, !tbaa !16
  %28 = getelementptr inbounds %struct.ComplexFloat, ptr %27, i64 %.05260.us64
  %.sroa.09.0.copyload.us65 = load <2 x float>, ptr %28, align 4
  %29 = tail call <2 x float> @complex_float_conjugate(<2 x float> %.sroa.09.0.copyload.us65)
  %30 = add nuw i64 %.05260.us64, 1
  %31 = icmp ult i64 %30, %16
  br i1 %31, label %.lr.ph62.split.us67, label %..loopexit_crit_edge.us, !llvm.loop !17

..loopexit_crit_edge.us:                          ; preds = %.lr.ph62.split.us67, %._crit_edge.us.us
  %32 = icmp ult i64 %18, %7
  br i1 %32, label %.preheader.split.us, label %.split.us, !llvm.loop !19

.lr.ph.us.us:                                     ; preds = %.lr.ph62.us, %._crit_edge.us.us
  %.05260.us.us = phi i64 [ %49, %._crit_edge.us.us ], [ %.04970, %.lr.ph62.us ]
  %33 = load ptr, ptr %12, align 8, !tbaa !16
  %34 = getelementptr inbounds %struct.ComplexFloat, ptr %33, i64 %.05260.us.us
  %.sroa.09.0.copyload.us.us = load <2 x float>, ptr %34, align 4
  %35 = tail call <2 x float> @complex_float_conjugate(<2 x float> %.sroa.09.0.copyload.us.us)
  %36 = mul i64 %.05260.us.us, %7
  br label %37

37:                                               ; preds = %37, %.lr.ph.us.us
  %.05059.us.us = phi i64 [ %25, %.lr.ph.us.us ], [ %47, %37 ]
  %38 = load ptr, ptr %12, align 8, !tbaa !16
  %39 = getelementptr inbounds %struct.ComplexFloat, ptr %38, i64 %.05059.us.us
  %40 = load <2 x float>, ptr %39, align 4
  %41 = tail call <2 x float> @complex_float_multiply(<2 x float> %35, <2 x float> %40)
  %42 = load ptr, ptr %13, align 8, !tbaa !20
  %43 = getelementptr %struct.ComplexFloat, ptr %42, i64 %36
  %44 = getelementptr %struct.ComplexFloat, ptr %43, i64 %.05059.us.us
  %45 = icmp eq i64 %.05260.us.us, %.05059.us.us
  %.sroa.0.0.us.us = select i1 %45, <2 x float> %COMPLEX_FLOAT_ONE.val, <2 x float> %COMPLEX_FLOAT_ZERO.val
  %46 = tail call <2 x float> @complex_float_subtract(<2 x float> %.sroa.0.0.us.us, <2 x float> %41)
  store <2 x float> %46, ptr %44, align 4
  %47 = add nuw i64 %.05059.us.us, 1
  %48 = icmp ult i64 %47, %19
  br i1 %48, label %37, label %._crit_edge.us.us, !llvm.loop !21

._crit_edge.us.us:                                ; preds = %37
  %49 = add nuw i64 %.05260.us.us, 1
  %50 = icmp ult i64 %49, %16
  br i1 %50, label %.lr.ph.us.us, label %..loopexit_crit_edge.us, !llvm.loop !17

.preheader.split:                                 ; preds = %.preheader
  br i1 %15, label %.preheader.split.split.us, label %.loopexit58

.preheader.split.split.us:                        ; preds = %.preheader.split
  %51 = load ptr, ptr %12, align 8, !tbaa !16
  %52 = getelementptr inbounds %struct.ComplexFloat, ptr %51, i64 %14
  br label %.loopexit.us69

.loopexit.us69:                                   ; preds = %.loopexit.us69, %.preheader.split.split.us
  %.05163.us68 = phi i64 [ 0, %.preheader.split.split.us ], [ %53, %.loopexit.us69 ]
  %53 = add i64 %.05163.us68, 32
  tail call void @llvm.prefetch.p0(ptr %52, i32 0, i32 3, i32 1)
  %54 = icmp ult i64 %53, %7
  br i1 %54, label %.loopexit.us69, label %.split.us, !llvm.loop !19

.split.us:                                        ; preds = %.loopexit.us69, %..loopexit_crit_edge.us
  br i1 %15, label %.preheader, label %.loopexit58, !llvm.loop !22

.loopexit58:                                      ; preds = %.preheader.split, %.split.us, %.preheader57, %10
  br label %55

55:                                               ; preds = %.loopexit58, %10, %5, %2
  %.1 = phi i32 [ -1, %2 ], [ -1, %5 ], [ 0, %.loopexit58 ], [ -7, %10 ]
  ret i32 %.1
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @llvm.prefetch.p0(ptr nocapture readonly, i32 immarg, i32 immarg, i32 immarg) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @complex_float_conjugate(<2 x float>) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @complex_float_multiply(<2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @complex_float_subtract(<2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !10, i64 8}
!6 = !{!"quantum_geometric_metric_t", !7, i64 0, !10, i64 8, !11, i64 16, !12, i64 24, !11, i64 32, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"quantum_state_t", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !7, i64 60}
!15 = !{!6, !7, i64 0}
!16 = !{!14, !11, i64 24}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!6, !11, i64 16}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


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