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

; 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.tensor_t = type { i64, ptr, ptr, i8, i64, ptr, i8, ptr, ptr }

@.str.7 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [41 x i8], align 1
@COMPLEX_FLOAT_ZERO = external hidden constant %struct.ComplexFloat, align 4

declare void @geometric_log_error(ptr noundef, ...) #0

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

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

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

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

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

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

16:                                               ; preds = %3
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %22

19:                                               ; preds = %16
  %20 = load i64, ptr %7, align 8, !tbaa !9
  %21 = icmp eq i64 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %19, %16, %3
  call void (ptr, ...) @geometric_log_error(ptr noundef @.str.7)
  store i1 false, ptr %4, align 1
  br label %129

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 1, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %24

24:                                               ; preds = %52, %23
  %25 = load i64, ptr %9, align 8, !tbaa !9
  %26 = load i64, ptr %7, align 8, !tbaa !9
  %27 = icmp ult i64 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %10, align 4
  br label %55

29:                                               ; preds = %24
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load i64, ptr %9, align 8, !tbaa !9
  %32 = getelementptr inbounds i64, ptr %30, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = icmp eq i64 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %29
  call void (ptr, ...) @geometric_log_error(ptr noundef @.str.8)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %55

36:                                               ; preds = %29
  %37 = load i64, ptr %8, align 8, !tbaa !9
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load i64, ptr %9, align 8, !tbaa !9
  %40 = getelementptr inbounds i64, ptr %38, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = udiv i64 -1, %41
  %43 = icmp ugt i64 %37, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %36
  call void (ptr, ...) @geometric_log_error(ptr noundef @.str.9)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %55

45:                                               ; preds = %36
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load i64, ptr %9, align 8, !tbaa !9
  %48 = getelementptr inbounds i64, ptr %46, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = load i64, ptr %8, align 8, !tbaa !9
  %51 = mul i64 %50, %49
  store i64 %51, ptr %8, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %45
  %53 = load i64, ptr %9, align 8, !tbaa !9
  %54 = add i64 %53, 1
  store i64 %54, ptr %9, align 8, !tbaa !9
  br label %24, !llvm.loop !11

55:                                               ; preds = %44, %35, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %56 = load i32, ptr %10, align 4
  switch i32 %56, label %128 [
    i32 2, label %57
  ]

57:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %58 = load i64, ptr %7, align 8, !tbaa !9
  %59 = mul i64 %58, 8
  %60 = call noalias ptr @malloc(i64 noundef %59) #8
  store ptr %60, ptr %11, align 8, !tbaa !5
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %64, label %63

63:                                               ; preds = %57
  call void (ptr, ...) @geometric_log_error(ptr noundef @.str.10)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %127

64:                                               ; preds = %57
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load i64, ptr %7, align 8, !tbaa !9
  %68 = mul i64 %67, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %65, ptr align 8 %66, i64 %68, i1 false)
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.tensor_t, ptr %70, i32 0, i32 1
  store ptr %69, ptr %71, align 8, !tbaa !13
  %72 = load i64, ptr %8, align 8, !tbaa !9
  %73 = mul i64 %72, 8
  %74 = call noalias ptr @malloc(i64 noundef %73) #8
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.tensor_t, ptr %75, i32 0, i32 2
  store ptr %74, ptr %76, align 8, !tbaa !16
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.tensor_t, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  %80 = icmp ne ptr %79, null
  br i1 %80, label %83, label %81

81:                                               ; preds = %64
  call void (ptr, ...) @geometric_log_error(ptr noundef @.str.11)
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %82) #7
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %127

83:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 8, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %107, %83
  %85 = load i64, ptr %13, align 8, !tbaa !9
  %86 = load i64, ptr %8, align 8, !tbaa !9
  %87 = icmp ult i64 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %110

89:                                               ; preds = %84
  %90 = load i64, ptr %13, align 8, !tbaa !9
  %91 = add i64 %90, 8
  %92 = load i64, ptr %8, align 8, !tbaa !9
  %93 = icmp ult i64 %91, %92
  br i1 %93, label %94, label %101

94:                                               ; preds = %89
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.tensor_t, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !16
  %98 = load i64, ptr %13, align 8, !tbaa !9
  %99 = add i64 %98, 8
  %100 = getelementptr inbounds %struct.ComplexFloat, ptr %97, i64 %99
  call void @llvm.prefetch.p0(ptr %100, i32 1, i32 3, i32 1)
  br label %101

101:                                              ; preds = %94, %89
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.tensor_t, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !16
  %105 = load i64, ptr %13, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct.ComplexFloat, ptr %104, i64 %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %106, ptr align 4 @COMPLEX_FLOAT_ZERO, i64 8, i1 false), !tbaa.struct !17
  br label %107

107:                                              ; preds = %101
  %108 = load i64, ptr %13, align 8, !tbaa !9
  %109 = add i64 %108, 1
  store i64 %109, ptr %13, align 8, !tbaa !9
  br label %84, !llvm.loop !20

110:                                              ; preds = %88
  %111 = load i64, ptr %7, align 8, !tbaa !9
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.tensor_t, ptr %112, i32 0, i32 0
  store i64 %111, ptr %113, align 8, !tbaa !21
  %114 = load i64, ptr %8, align 8, !tbaa !9
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.tensor_t, ptr %115, i32 0, i32 4
  store i64 %114, ptr %116, align 8, !tbaa !22
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.tensor_t, ptr %117, i32 0, i32 3
  store i8 1, ptr %118, align 8, !tbaa !23
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.tensor_t, ptr %119, i32 0, i32 5
  store ptr null, ptr %120, align 8, !tbaa !24
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.tensor_t, ptr %121, i32 0, i32 6
  store i8 1, ptr %122, align 8, !tbaa !25
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.tensor_t, ptr %123, i32 0, i32 7
  store ptr null, ptr %124, align 8, !tbaa !26
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.tensor_t, ptr %125, i32 0, i32 8
  store ptr null, ptr %126, align 8, !tbaa !27
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %127

127:                                              ; preds = %110, %81, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %128

128:                                              ; preds = %127, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %129

129:                                              ; preds = %128, %22
  %130 = load i1, ptr %4, align 1
  ret i1 %130
}

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

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


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

@.str.7 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [41 x i8], align 1
@COMPLEX_FLOAT_ZERO = external hidden local_unnamed_addr constant %struct.ComplexFloat, align 4

declare void @geometric_log_error(ptr noundef, ...) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @qg_tensor_init(ptr noundef %0, ptr noundef readonly %1, i64 noundef %2) local_unnamed_addr #4 {
  %4 = icmp eq ptr %0, null
  %5 = icmp eq ptr %1, null
  %or.cond.not56 = or i1 %4, %5
  %6 = icmp eq i64 %2, 0
  %or.cond3 = or i1 %or.cond.not56, %6
  br i1 %or.cond3, label %7, label %.preheader59

7:                                                ; preds = %3
  tail call void (ptr, ...) @geometric_log_error(ptr noundef nonnull @.str.7) #8
  br label %53

.preheader59:                                     ; preds = %3, %14
  %.04863 = phi i64 [ %15, %14 ], [ 1, %3 ]
  %.05062 = phi i64 [ %16, %14 ], [ 0, %3 ]
  %8 = getelementptr inbounds i64, ptr %1, i64 %.05062
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i64 %9, 0
  br i1 %10, label %11, label %12

11:                                               ; preds = %.preheader59
  tail call void (ptr, ...) @geometric_log_error(ptr noundef nonnull @.str.8) #8
  br label %53

12:                                               ; preds = %.preheader59
  %mul = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %9, i64 %.04863)
  %mul.ov = extractvalue { i64, i1 } %mul, 1
  br i1 %mul.ov, label %13, label %14

13:                                               ; preds = %12
  tail call void (ptr, ...) @geometric_log_error(ptr noundef nonnull @.str.9) #8
  br label %53

14:                                               ; preds = %12
  %15 = mul i64 %9, %.04863
  %16 = add nuw i64 %.05062, 1
  %exitcond.not = icmp eq i64 %16, %2
  br i1 %exitcond.not, label %.critedge, label %.preheader59, !llvm.loop !9

.critedge:                                        ; preds = %14
  %17 = shl i64 %2, 3
  %18 = tail call noalias ptr @malloc(i64 noundef %17) #9
  %.not57 = icmp eq ptr %18, null
  br i1 %.not57, label %19, label %20

19:                                               ; preds = %.critedge
  tail call void (ptr, ...) @geometric_log_error(ptr noundef nonnull @.str.10) #8
  br label %53

20:                                               ; preds = %.critedge
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %18, ptr nonnull align 8 %1, i64 %17, i1 false)
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %18, ptr %21, align 8, !tbaa !11
  %22 = shl i64 %15, 3
  %23 = tail call noalias ptr @malloc(i64 noundef %22) #9
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %23, ptr %24, align 8, !tbaa !15
  %.not58 = icmp eq ptr %23, null
  br i1 %.not58, label %27, label %.preheader

.preheader:                                       ; preds = %20
  %.not65 = icmp eq i64 %15, 0
  br i1 %.not65, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %25 = load i64, ptr @COMPLEX_FLOAT_ZERO, align 4
  %xtraiter = and i64 %15, 1
  %26 = icmp eq i64 %15, 1
  br i1 %26, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %15, -2
  br label %38

27:                                               ; preds = %20
  tail call void (ptr, ...) @geometric_log_error(ptr noundef nonnull @.str.11) #8
  tail call void @free(ptr noundef nonnull %18) #8
  br label %53

._crit_edge.loopexit.unr-lcssa:                   ; preds = %50, %.lr.ph
  %.064.unr = phi i64 [ 0, %.lr.ph ], [ %52, %50 ]
  %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
  %28 = add i64 %.064.unr, 8
  %29 = icmp ult i64 %28, %15
  %.pre.epil = load ptr, ptr %24, align 8, !tbaa !15
  br i1 %29, label %30, label %._crit_edge.loopexit.epilog-lcssa

30:                                               ; preds = %.epil.preheader
  %31 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre.epil, i64 %28
  tail call void @llvm.prefetch.p0(ptr %31, i32 1, i32 3, i32 1)
  br label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %30, %.epil.preheader
  %32 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre.epil, i64 %.064.unr
  store i64 %25, ptr %32, align 4
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %.preheader
  store i64 %2, ptr %0, align 8, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 %15, ptr %33, align 8, !tbaa !17
  %34 = getelementptr inbounds i8, ptr %0, i64 24
  store i8 1, ptr %34, align 8, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr null, ptr %35, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 1, ptr %36, align 8, !tbaa !20
  %37 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %37, i8 0, i64 16, i1 false)
  br label %53

38:                                               ; preds = %50, %.lr.ph.new
  %.064 = phi i64 [ 0, %.lr.ph.new ], [ %52, %50 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %50 ]
  %39 = add i64 %.064, 8
  %40 = icmp ult i64 %39, %15
  %.pre = load ptr, ptr %24, align 8, !tbaa !15
  br i1 %40, label %41, label %43

41:                                               ; preds = %38
  %42 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre, i64 %39
  tail call void @llvm.prefetch.p0(ptr %42, i32 1, i32 3, i32 1)
  br label %43

43:                                               ; preds = %41, %38
  %44 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre, i64 %.064
  store i64 %25, ptr %44, align 4
  %45 = or disjoint i64 %.064, 1
  %46 = add i64 %.064, 9
  %47 = icmp ult i64 %46, %15
  %.pre.1 = load ptr, ptr %24, align 8, !tbaa !15
  br i1 %47, label %48, label %50

48:                                               ; preds = %43
  %49 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre.1, i64 %46
  tail call void @llvm.prefetch.p0(ptr nonnull %49, i32 1, i32 3, i32 1)
  br label %50

50:                                               ; preds = %48, %43
  %51 = getelementptr inbounds %struct.ComplexFloat, ptr %.pre.1, i64 %45
  store i64 %25, ptr %51, align 4
  %52 = add nuw i64 %.064, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %38, !llvm.loop !21

53:                                               ; preds = %11, %13, %._crit_edge, %27, %19, %7
  %.3 = phi i1 [ false, %7 ], [ true, %._crit_edge ], [ false, %27 ], [ false, %19 ], [ false, %13 ], [ false, %11 ]
  ret i1 %.3
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #6

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

attributes #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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 8}
!12 = !{!"tensor_t", !6, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !6, i64 32, !13, i64 40, !14, i64 48, !13, i64 56, !13, i64 64}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!12, !13, i64 16}
!16 = !{!12, !6, i64 0}
!17 = !{!12, !6, i64 32}
!18 = !{!12, !14, i64 24}
!19 = !{!12, !13, i64 40}
!20 = !{!12, !14, i64 48}
!21 = distinct !{!21, !10}


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