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

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

@.str.16 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [39 x i8], align 1
@__const.compute_quantum_geometric_tensor.shift_amounts = external hidden unnamed_addr constant [3 x double], align 16

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

; Function Attrs: nounwind uwtable
declare hidden void @set_error(ptr noundef) #1

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

; 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) #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @get_quantum_state(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @compute_quantum_geometric_tensor(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3) #1 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.numerical_config_t, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca [3 x double], align 16
  %19 = alloca i64, align 8
  %20 = alloca %struct.ComplexFloat, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %26

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

26:                                               ; preds = %23, %4
  call void @set_error(ptr noundef @.str.16)
  store i1 false, ptr %5, align 1
  br label %141

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #7
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 40, i1 false)
  %28 = getelementptr inbounds %struct.numerical_config_t, ptr %10, i32 0, i32 1
  store i64 1, ptr %28, align 8
  %29 = getelementptr inbounds %struct.numerical_config_t, ptr %10, i32 0, i32 2
  store i8 1, ptr %29, align 8
  %30 = getelementptr inbounds %struct.numerical_config_t, ptr %10, i32 0, i32 3
  store i8 1, ptr %30, align 1
  %31 = getelementptr inbounds %struct.numerical_config_t, ptr %10, i32 0, i32 4
  store i8 1, ptr %31, align 2
  %32 = getelementptr inbounds %struct.numerical_config_t, ptr %10, i32 0, i32 5
  store i64 33554432, ptr %32, align 8
  %33 = call zeroext i1 @initialize_numerical_backend(ptr noundef %10)
  br i1 %33, label %35, label %34

34:                                               ; preds = %27
  call void @set_error(ptr noundef @.str.17)
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %140

35:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call zeroext i1 @get_quantum_state(ptr noundef %36, ptr noundef %12, ptr noundef %13)
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %139

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 @__const.compute_quantum_geometric_tensor.shift_amounts, i64 24, i1 false)
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %43 = call zeroext i1 @compute_higher_order_gradient(ptr noundef %40, i64 noundef %41, ptr noundef %42, i64 noundef 3, ptr noundef %14, ptr noundef %16)
  br i1 %43, label %46, label %44

44:                                               ; preds = %39
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %45) #7
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %138

46:                                               ; preds = %39
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load i64, ptr %8, align 8, !tbaa !9
  %49 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %50 = call zeroext i1 @compute_higher_order_gradient(ptr noundef %47, i64 noundef %48, ptr noundef %49, i64 noundef 3, ptr noundef %15, ptr noundef %17)
  br i1 %50, label %54, label %51

51:                                               ; preds = %46
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %52) #7
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %53) #7
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %138

54:                                               ; preds = %46
  %55 = load i64, ptr %16, align 8, !tbaa !9
  %56 = load i64, ptr %17, align 8, !tbaa !9
  %57 = icmp ne i64 %55, %56
  br i1 %57, label %62, label %58

58:                                               ; preds = %54
  %59 = load i64, ptr %16, align 8, !tbaa !9
  %60 = load i64, ptr %13, align 8, !tbaa !9
  %61 = icmp ne i64 %59, %60
  br i1 %61, label %62, label %66

62:                                               ; preds = %58, %54
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %63) #7
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %64) #7
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %65) #7
  store i1 false, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %138

66:                                               ; preds = %58
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ComplexFloat, ptr %67, i32 0, i32 0
  store float 0.000000e+00, ptr %68, align 4, !tbaa !11
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ComplexFloat, ptr %69, i32 0, i32 1
  store float 0.000000e+00, ptr %70, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %131, %66
  %72 = load i64, ptr %19, align 8, !tbaa !9
  %73 = load i64, ptr %13, align 8, !tbaa !9
  %74 = icmp ult i64 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %134

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %77 = getelementptr inbounds %struct.ComplexFloat, ptr %20, i32 0, i32 0
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = load i64, ptr %19, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.ComplexFloat, ptr %78, i64 %79
  %81 = getelementptr inbounds %struct.ComplexFloat, ptr %80, i32 0, i32 0
  %82 = load float, ptr %81, align 4, !tbaa !11
  store float %82, ptr %77, align 4, !tbaa !11
  %83 = getelementptr inbounds %struct.ComplexFloat, ptr %20, i32 0, i32 1
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = load i64, ptr %19, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.ComplexFloat, ptr %84, i64 %85
  %87 = getelementptr inbounds %struct.ComplexFloat, ptr %86, i32 0, i32 1
  %88 = load float, ptr %87, align 4, !tbaa !14
  %89 = fneg float %88
  store float %89, ptr %83, align 4, !tbaa !14
  %90 = getelementptr inbounds %struct.ComplexFloat, ptr %20, i32 0, i32 0
  %91 = load float, ptr %90, align 4, !tbaa !11
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = load i64, ptr %19, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.ComplexFloat, ptr %92, i64 %93
  %95 = getelementptr inbounds %struct.ComplexFloat, ptr %94, i32 0, i32 0
  %96 = load float, ptr %95, align 4, !tbaa !11
  %97 = getelementptr inbounds %struct.ComplexFloat, ptr %20, i32 0, i32 1
  %98 = load float, ptr %97, align 4, !tbaa !14
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  %100 = load i64, ptr %19, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.ComplexFloat, ptr %99, i64 %100
  %102 = getelementptr inbounds %struct.ComplexFloat, ptr %101, i32 0, i32 1
  %103 = load float, ptr %102, align 4, !tbaa !14
  %104 = fmul float %98, %103
  %105 = fneg float %104
  %106 = call float @llvm.fmuladd.f32(float %91, float %96, float %105)
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ComplexFloat, ptr %107, i32 0, i32 0
  %109 = load float, ptr %108, align 4, !tbaa !11
  %110 = fadd float %109, %106
  store float %110, ptr %108, align 4, !tbaa !11
  %111 = getelementptr inbounds %struct.ComplexFloat, ptr %20, i32 0, i32 0
  %112 = load float, ptr %111, align 4, !tbaa !11
  %113 = load ptr, ptr %15, align 8, !tbaa !5
  %114 = load i64, ptr %19, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.ComplexFloat, ptr %113, i64 %114
  %116 = getelementptr inbounds %struct.ComplexFloat, ptr %115, i32 0, i32 1
  %117 = load float, ptr %116, align 4, !tbaa !14
  %118 = getelementptr inbounds %struct.ComplexFloat, ptr %20, i32 0, i32 1
  %119 = load float, ptr %118, align 4, !tbaa !14
  %120 = load ptr, ptr %15, align 8, !tbaa !5
  %121 = load i64, ptr %19, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.ComplexFloat, ptr %120, i64 %121
  %123 = getelementptr inbounds %struct.ComplexFloat, ptr %122, i32 0, i32 0
  %124 = load float, ptr %123, align 4, !tbaa !11
  %125 = fmul float %119, %124
  %126 = call float @llvm.fmuladd.f32(float %112, float %117, float %125)
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ComplexFloat, ptr %127, i32 0, i32 1
  %129 = load float, ptr %128, align 4, !tbaa !14
  %130 = fadd float %129, %126
  store float %130, ptr %128, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %131

131:                                              ; preds = %76
  %132 = load i64, ptr %19, align 8, !tbaa !9
  %133 = add i64 %132, 1
  store i64 %133, ptr %19, align 8, !tbaa !9
  br label %71, !llvm.loop !15

134:                                              ; preds = %75
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %135) #7
  %136 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %136) #7
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %137) #7
  store i1 true, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %138

138:                                              ; preds = %134, %62, %51, %44
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %139

139:                                              ; preds = %138, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %140

140:                                              ; preds = %139, %34
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #7
  br label %141

141:                                              ; preds = %140, %26
  %142 = load i1, ptr %5, align 1
  ret i1 %142
}

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

declare zeroext i1 @initialize_numerical_backend(ptr noundef) #6

declare zeroext i1 @compute_higher_order_gradient(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #6

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 "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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { "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 #7 = { 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"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.numerical_config_t = type { i32, i64, i8, i8, i8, i64, ptr }
%struct.ComplexFloat = type { float, float }

@.str.16 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [39 x i8], align 1
@__const.compute_quantum_geometric_tensor.shift_amounts = external hidden unnamed_addr constant [3 x double], align 16

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

; Function Attrs: nounwind uwtable
declare hidden void @set_error(ptr 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 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) #3

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @get_quantum_state(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @compute_quantum_geometric_tensor(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef writeonly %3) local_unnamed_addr #1 {
  %5 = alloca %struct.numerical_config_t, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca [3 x double], align 16
  %13 = icmp ne ptr %0, null
  %14 = icmp ne ptr %3, null
  %or.cond = and i1 %13, %14
  br i1 %or.cond, label %16, label %15

15:                                               ; preds = %4
  tail call void @set_error(ptr noundef nonnull @.str.16)
  br label %64

16:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %5, i8 0, i64 40, i1 false)
  %17 = getelementptr inbounds i8, ptr %5, i64 8
  store i64 1, ptr %17, align 8
  %18 = getelementptr inbounds i8, ptr %5, i64 16
  store i8 1, ptr %18, align 8
  %19 = getelementptr inbounds i8, ptr %5, i64 17
  store i8 1, ptr %19, align 1
  %20 = getelementptr inbounds i8, ptr %5, i64 18
  store i8 1, ptr %20, align 2
  %21 = getelementptr inbounds i8, ptr %5, i64 24
  store i64 33554432, ptr %21, align 8
  %22 = call zeroext i1 @initialize_numerical_backend(ptr noundef nonnull %5) #7
  br i1 %22, label %24, label %23

23:                                               ; preds = %16
  call void @set_error(ptr noundef nonnull @.str.17)
  br label %63

24:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %25 = call zeroext i1 @get_quantum_state(ptr noundef nonnull %0, ptr noundef nonnull %6, ptr noundef nonnull %7)
  br i1 %25, label %26, label %62

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %12, ptr noundef nonnull align 16 dereferenceable(24) @__const.compute_quantum_geometric_tensor.shift_amounts, i64 24, i1 false)
  %27 = call zeroext i1 @compute_higher_order_gradient(ptr noundef nonnull %0, i64 noundef %1, ptr noundef nonnull %12, i64 noundef 3, ptr noundef nonnull %8, ptr noundef nonnull %10) #7
  br i1 %27, label %28, label %61

28:                                               ; preds = %26
  %29 = call zeroext i1 @compute_higher_order_gradient(ptr noundef nonnull %0, i64 noundef %2, ptr noundef nonnull %12, i64 noundef 3, ptr noundef nonnull %9, ptr noundef nonnull %11) #7
  br i1 %29, label %30, label %.sink.split

30:                                               ; preds = %28
  %31 = load i64, ptr %10, align 8, !tbaa !5
  %32 = load i64, ptr %11, align 8, !tbaa !5
  %.not = icmp eq i64 %31, %32
  %33 = load i64, ptr %7, align 8
  %.not26 = icmp eq i64 %31, %33
  %or.cond27 = select i1 %.not, i1 %.not26, i1 false
  br i1 %or.cond27, label %36, label %34

34:                                               ; preds = %30
  %35 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %35) #7
  br label %.sink.split

36:                                               ; preds = %30
  %37 = getelementptr inbounds i8, ptr %3, i64 4
  store <2 x float> zeroinitializer, ptr %3, align 4, !tbaa !11
  %.not30 = icmp eq i64 %31, 0
  br i1 %.not30, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %36
  %38 = load ptr, ptr %8, align 8, !tbaa !9
  %39 = load ptr, ptr %9, align 8, !tbaa !9
  br label %41

._crit_edge:                                      ; preds = %41, %36
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %40) #7
  br label %.sink.split

41:                                               ; preds = %.lr.ph, %41
  %42 = phi float [ 0.000000e+00, %.lr.ph ], [ %59, %41 ]
  %43 = phi float [ 0.000000e+00, %.lr.ph ], [ %55, %41 ]
  %.02228 = phi i64 [ 0, %.lr.ph ], [ %60, %41 ]
  %44 = getelementptr inbounds %struct.ComplexFloat, ptr %38, i64 %.02228
  %45 = load float, ptr %44, align 4, !tbaa !13
  %46 = getelementptr inbounds i8, ptr %44, i64 4
  %47 = load float, ptr %46, align 4, !tbaa !15
  %48 = fneg float %47
  %49 = getelementptr inbounds %struct.ComplexFloat, ptr %39, i64 %.02228
  %50 = load float, ptr %49, align 4, !tbaa !13
  %51 = getelementptr inbounds i8, ptr %49, i64 4
  %52 = load float, ptr %51, align 4, !tbaa !15
  %53 = fmul float %47, %52
  %54 = call float @llvm.fmuladd.f32(float %45, float %50, float %53)
  %55 = fadd float %43, %54
  store float %55, ptr %3, align 4, !tbaa !13
  %56 = load float, ptr %49, align 4, !tbaa !13
  %57 = fmul float %56, %48
  %58 = call float @llvm.fmuladd.f32(float %45, float %52, float %57)
  %59 = fadd float %42, %58
  store float %59, ptr %37, align 4, !tbaa !15
  %60 = add nuw i64 %.02228, 1
  %exitcond.not = icmp eq i64 %60, %31
  br i1 %exitcond.not, label %._crit_edge, label %41, !llvm.loop !16

.sink.split:                                      ; preds = %28, %34, %._crit_edge
  %.sink31.in = phi ptr [ %8, %._crit_edge ], [ %8, %34 ], [ %6, %28 ]
  %.sink.in.ph = phi ptr [ %9, %._crit_edge ], [ %9, %34 ], [ %8, %28 ]
  %.0.ph = phi i1 [ true, %._crit_edge ], [ false, %34 ], [ false, %28 ]
  %.sink31 = load ptr, ptr %.sink31.in, align 8, !tbaa !9
  call void @free(ptr noundef %.sink31) #7
  br label %61

61:                                               ; preds = %.sink.split, %26
  %.sink.in = phi ptr [ %6, %26 ], [ %.sink.in.ph, %.sink.split ]
  %.0 = phi i1 [ false, %26 ], [ %.0.ph, %.sink.split ]
  %.sink = load ptr, ptr %.sink.in, align 8, !tbaa !9
  call void @free(ptr noundef %.sink) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %62

62:                                               ; preds = %24, %61
  %.1 = phi i1 [ %.0, %61 ], [ false, %24 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %63

63:                                               ; preds = %62, %23
  %.2 = phi i1 [ %.1, %62 ], [ false, %23 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  br label %64

64:                                               ; preds = %63, %15
  %.3 = phi i1 [ %.2, %63 ], [ false, %15 ]
  ret i1 %.3
}

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

declare zeroext i1 @initialize_numerical_backend(ptr noundef) local_unnamed_addr #6

declare zeroext i1 @compute_higher_order_gradient(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

attributes #0 = { mustprogress 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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { "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 #7 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"", !12, i64 0, !12, i64 4}
!15 = !{!14, !12, i64 4}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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