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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @compute_parameter_shift_gradient(ptr noundef %0, i64 noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %29

20:                                               ; preds = %5
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %29

23:                                               ; preds = %20
  %24 = load ptr, ptr %11, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = load double, ptr %9, align 8, !tbaa !11
  %28 = fcmp ole double %27, 0.000000e+00
  br i1 %28, label %29, label %30

29:                                               ; preds = %26, %23, %20, %5
  store i1 false, ptr %6, align 1
  br label %113

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call ptr @copy_quantum_geometric_tensor_network(ptr noundef %31)
  store ptr %32, ptr %12, align 8, !tbaa !5
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %30
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %112

36:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = load double, ptr %9, align 8, !tbaa !11
  %40 = call zeroext i1 @compute_shifted_states(ptr noundef %37, i64 noundef %38, double noundef %39, ptr noundef %14, ptr noundef %15, ptr noundef %16)
  br i1 %40, label %43, label %41

41:                                               ; preds = %36
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  call void @destroy_quantum_geometric_tensor_network(ptr noundef %42)
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %111

43:                                               ; preds = %36
  %44 = load i64, ptr %16, align 8, !tbaa !9
  %45 = mul i64 %44, 8
  %46 = call noalias ptr @malloc(i64 noundef %45) #6
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %46, ptr %47, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %54, label %51

51:                                               ; preds = %43
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %52) #5
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %53) #5
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %111

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

55:                                               ; preds = %103, %54
  %56 = load i64, ptr %17, align 8, !tbaa !9
  %57 = load i64, ptr %16, align 8, !tbaa !9
  %58 = icmp ult i64 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %106

60:                                               ; preds = %55
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = load i64, ptr %17, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.ComplexFloat, ptr %61, i64 %62
  %64 = getelementptr inbounds %struct.ComplexFloat, ptr %63, i32 0, i32 0
  %65 = load float, ptr %64, align 4, !tbaa !13
  %66 = load ptr, ptr %15, align 8, !tbaa !5
  %67 = load i64, ptr %17, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.ComplexFloat, ptr %66, i64 %67
  %69 = getelementptr inbounds %struct.ComplexFloat, ptr %68, i32 0, i32 0
  %70 = load float, ptr %69, align 4, !tbaa !13
  %71 = fsub float %65, %70
  %72 = fpext float %71 to double
  %73 = load double, ptr %9, align 8, !tbaa !11
  %74 = fmul double 2.000000e+00, %73
  %75 = fdiv double %72, %74
  %76 = fptrunc double %75 to float
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr %17, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.ComplexFloat, ptr %78, i64 %79
  %81 = getelementptr inbounds %struct.ComplexFloat, ptr %80, i32 0, i32 0
  store float %76, ptr %81, align 4, !tbaa !13
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = load i64, ptr %17, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.ComplexFloat, ptr %82, i64 %83
  %85 = getelementptr inbounds %struct.ComplexFloat, ptr %84, i32 0, i32 1
  %86 = load float, ptr %85, align 4, !tbaa !16
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = load i64, ptr %17, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.ComplexFloat, ptr %87, i64 %88
  %90 = getelementptr inbounds %struct.ComplexFloat, ptr %89, i32 0, i32 1
  %91 = load float, ptr %90, align 4, !tbaa !16
  %92 = fsub float %86, %91
  %93 = fpext float %92 to double
  %94 = load double, ptr %9, align 8, !tbaa !11
  %95 = fmul double 2.000000e+00, %94
  %96 = fdiv double %93, %95
  %97 = fptrunc double %96 to float
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = load i64, ptr %17, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.ComplexFloat, ptr %99, i64 %100
  %102 = getelementptr inbounds %struct.ComplexFloat, ptr %101, i32 0, i32 1
  store float %97, ptr %102, align 4, !tbaa !16
  br label %103

103:                                              ; preds = %60
  %104 = load i64, ptr %17, align 8, !tbaa !9
  %105 = add i64 %104, 1
  store i64 %105, ptr %17, align 8, !tbaa !9
  br label %55, !llvm.loop !17

106:                                              ; preds = %59
  %107 = load i64, ptr %16, align 8, !tbaa !9
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %107, ptr %108, align 8, !tbaa !9
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %109) #5
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %110) #5
  store i1 true, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %111

111:                                              ; preds = %106, %51, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %112

112:                                              ; preds = %111, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %113

113:                                              ; preds = %112, %29
  %114 = load i1, ptr %6, align 1
  ret i1 %114
}

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

; Function Attrs: nounwind uwtable
declare hidden ptr @copy_quantum_geometric_tensor_network(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @compute_shifted_states(ptr noundef, i64 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare void @destroy_quantum_geometric_tensor_network(ptr noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

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

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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) "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 "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 }
attributes #6 = { nounwind allocsize(0) }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !15, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!14, !15, i64 4}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @compute_parameter_shift_gradient(ptr noundef %0, i64 noundef %1, double noundef %2, ptr noundef writeonly %3, ptr noundef writeonly %4) local_unnamed_addr #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = icmp eq ptr %0, null
  %10 = icmp eq ptr %3, null
  %or.cond.not37 = or i1 %9, %10
  %11 = icmp eq ptr %4, null
  %or.cond3.not34 = or i1 %or.cond.not37, %11
  %12 = fcmp ole double %2, 0.000000e+00
  %or.cond5 = or i1 %12, %or.cond3.not34
  br i1 %or.cond5, label %81, label %13

13:                                               ; preds = %5
  %14 = tail call ptr @copy_quantum_geometric_tensor_network(ptr noundef nonnull %0)
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %81, label %15

15:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %16 = call zeroext i1 @compute_shifted_states(ptr noundef nonnull %14, i64 noundef %1, double noundef %2, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  br i1 %16, label %18, label %17

17:                                               ; preds = %15
  call void @destroy_quantum_geometric_tensor_network(ptr noundef nonnull %14) #5
  br label %80

18:                                               ; preds = %15
  %19 = load i64, ptr %8, align 8, !tbaa !5
  %20 = shl i64 %19, 3
  %21 = call noalias ptr @malloc(i64 noundef %20) #6
  store ptr %21, ptr %3, align 8, !tbaa !9
  %.not38 = icmp eq ptr %21, null
  br i1 %.not38, label %56, label %.preheader

.preheader:                                       ; preds = %18
  %.not40 = icmp eq i64 %19, 0
  %.pre = load ptr, ptr %6, align 8, !tbaa !9
  br i1 %.not40, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %22 = load ptr, ptr %7, align 8, !tbaa !9
  %23 = fmul double %2, 2.000000e+00
  %min.iters.check = icmp eq i64 %19, 1
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %.039.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %.neg = or disjoint i64 %.039.ph, 1
  %xtraiter = and i64 %19, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %24 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre, i64 %.039.ph
  %25 = getelementptr inbounds %struct.ComplexFloat, ptr %22, i64 %.039.ph
  %26 = getelementptr inbounds %struct.ComplexFloat, ptr %21, i64 %.039.ph
  %27 = load <2 x float>, ptr %24, align 4, !tbaa !11
  %28 = load <2 x float>, ptr %25, align 4, !tbaa !11
  %29 = fsub <2 x float> %27, %28
  %30 = fpext <2 x float> %29 to <2 x double>
  %31 = insertelement <2 x double> poison, double %23, i64 0
  %32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
  %33 = fdiv <2 x double> %30, %32
  %34 = fptrunc <2 x double> %33 to <2 x float>
  store <2 x float> %34, ptr %26, align 4, !tbaa !11
  %35 = or disjoint i64 %.039.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %.039.unr = phi i64 [ %.039.ph, %scalar.ph.preheader ], [ %35, %scalar.ph.prol ]
  %36 = icmp eq i64 %19, %.neg
  br i1 %36, label %._crit_edge, label %scalar.ph.preheader.new

scalar.ph.preheader.new:                          ; preds = %scalar.ph.prol.loopexit
  %37 = insertelement <2 x double> poison, double %23, i64 0
  %38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
  %39 = insertelement <2 x double> poison, double %23, i64 0
  %40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
  br label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph
  %41 = shl i64 %19, 3
  %42 = add i64 %41, -4
  %scevgep = getelementptr i8, ptr %21, i64 %42
  %scevgep41 = getelementptr i8, ptr %.pre, i64 %42
  %scevgep42 = getelementptr i8, ptr %22, i64 %42
  %scevgep43 = getelementptr i8, ptr %21, i64 4
  %scevgep44 = getelementptr i8, ptr %21, i64 %41
  %scevgep45 = getelementptr i8, ptr %.pre, i64 4
  %scevgep46 = getelementptr i8, ptr %.pre, i64 %41
  %scevgep47 = getelementptr i8, ptr %22, i64 4
  %scevgep48 = getelementptr i8, ptr %22, i64 %41
  %bound0 = icmp ult ptr %21, %scevgep41
  %bound1 = icmp ult ptr %.pre, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound049 = icmp ult ptr %21, %scevgep42
  %bound150 = icmp ult ptr %22, %scevgep
  %found.conflict51 = and i1 %bound049, %bound150
  %conflict.rdx = or i1 %found.conflict, %found.conflict51
  %bound052 = icmp ult ptr %scevgep43, %scevgep46
  %bound153 = icmp ult ptr %scevgep45, %scevgep44
  %found.conflict54 = and i1 %bound052, %bound153
  %conflict.rdx55 = or i1 %conflict.rdx, %found.conflict54
  %bound056 = icmp ult ptr %scevgep43, %scevgep48
  %bound157 = icmp ult ptr %scevgep47, %scevgep44
  %found.conflict58 = and i1 %bound056, %bound157
  %conflict.rdx59 = or i1 %conflict.rdx55, %found.conflict58
  br i1 %conflict.rdx59, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %19, -2
  %broadcast.splatinsert = insertelement <2 x double> poison, double %23, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %43 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre, i64 %index
  %wide.vec = load <4 x float>, ptr %43, align 4, !tbaa !11
  %44 = getelementptr inbounds %struct.ComplexFloat, ptr %22, i64 %index
  %wide.vec61 = load <4 x float>, ptr %44, align 4, !tbaa !11
  %45 = fsub <4 x float> %wide.vec, %wide.vec61
  %46 = shufflevector <4 x float> %45, <4 x float> poison, <2 x i32> <i32 0, i32 2>
  %47 = fpext <2 x float> %46 to <2 x double>
  %48 = fdiv <2 x double> %47, %broadcast.splat
  %49 = fsub <4 x float> %wide.vec, %wide.vec61
  %50 = shufflevector <4 x float> %49, <4 x float> poison, <2 x i32> <i32 1, i32 3>
  %51 = fpext <2 x float> %50 to <2 x double>
  %52 = fdiv <2 x double> %51, %broadcast.splat
  %53 = getelementptr inbounds %struct.ComplexFloat, ptr %21, i64 %index
  %54 = shufflevector <2 x double> %48, <2 x double> %52, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  %interleaved.vec = fptrunc <4 x double> %54 to <4 x float>
  store <4 x float> %interleaved.vec, ptr %53, align 4, !tbaa !11
  %index.next = add nuw i64 %index, 2
  %55 = icmp eq i64 %index.next, %n.vec
  br i1 %55, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %19, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

56:                                               ; preds = %18
  %57 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %57) #5
  %58 = load ptr, ptr %7, align 8, !tbaa !9
  call void @free(ptr noundef %58) #5
  br label %80

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.preheader
  store i64 %19, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %.pre) #5
  %59 = load ptr, ptr %7, align 8, !tbaa !9
  call void @free(ptr noundef %59) #5
  br label %80

scalar.ph:                                        ; preds = %scalar.ph, %scalar.ph.preheader.new
  %.039 = phi i64 [ %.039.unr, %scalar.ph.preheader.new ], [ %79, %scalar.ph ]
  %60 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre, i64 %.039
  %61 = getelementptr inbounds %struct.ComplexFloat, ptr %22, i64 %.039
  %62 = getelementptr inbounds %struct.ComplexFloat, ptr %21, i64 %.039
  %63 = load <2 x float>, ptr %60, align 4, !tbaa !11
  %64 = load <2 x float>, ptr %61, align 4, !tbaa !11
  %65 = fsub <2 x float> %63, %64
  %66 = fpext <2 x float> %65 to <2 x double>
  %67 = fdiv <2 x double> %66, %38
  %68 = fptrunc <2 x double> %67 to <2 x float>
  store <2 x float> %68, ptr %62, align 4, !tbaa !11
  %69 = add nuw i64 %.039, 1
  %70 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre, i64 %69
  %71 = getelementptr inbounds %struct.ComplexFloat, ptr %22, i64 %69
  %72 = getelementptr inbounds %struct.ComplexFloat, ptr %21, i64 %69
  %73 = load <2 x float>, ptr %70, align 4, !tbaa !11
  %74 = load <2 x float>, ptr %71, align 4, !tbaa !11
  %75 = fsub <2 x float> %73, %74
  %76 = fpext <2 x float> %75 to <2 x double>
  %77 = fdiv <2 x double> %76, %40
  %78 = fptrunc <2 x double> %77 to <2 x float>
  store <2 x float> %78, ptr %72, align 4, !tbaa !11
  %79 = add nuw i64 %.039, 2
  %exitcond.not.1 = icmp eq i64 %79, %19
  br i1 %exitcond.not.1, label %._crit_edge, label %scalar.ph, !llvm.loop !17

80:                                               ; preds = %._crit_edge, %56, %17
  %.030 = phi i1 [ true, %._crit_edge ], [ false, %56 ], [ false, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %81

81:                                               ; preds = %80, %13, %5
  %.2 = phi i1 [ false, %5 ], [ %.030, %80 ], [ false, %13 ]
  ret i1 %.2
}

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

; Function Attrs: nounwind uwtable
declare hidden ptr @copy_quantum_geometric_tensor_network(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @compute_shifted_states(ptr noundef, i64 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @destroy_quantum_geometric_tensor_network(ptr noundef) local_unnamed_addr #2

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

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

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

attributes #0 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !15}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass