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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.anon = type { i32, i8, i64, ptr }
%struct.ComplexFloat = type { float, float }

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @initialize_lapack() #0

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @convert_layout(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef) #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) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @lapack_lu(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6) #0 {
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i64 %1, ptr %10, align 8, !tbaa !9
  store i64 %2, ptr %11, align 8, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store i32 %6, ptr %15, align 4, !tbaa !11
  %24 = call zeroext i1 @initialize_lapack()
  br i1 %24, label %25, label %43

25:                                               ; preds = %7
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %43

28:                                               ; preds = %25
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %43

31:                                               ; preds = %28
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %43

34:                                               ; preds = %31
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %43

37:                                               ; preds = %34
  %38 = load i64, ptr %10, align 8, !tbaa !9
  %39 = icmp eq i64 %38, 0
  br i1 %39, label %43, label %40

40:                                               ; preds = %37
  %41 = load i64, ptr %11, align 8, !tbaa !9
  %42 = icmp eq i64 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %40, %37, %34, %31, %28, %25, %7
  store i32 -1, ptr @lapack_state, align 8, !tbaa !13
  store i1 false, ptr %8, align 1
  br label %177

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %45 = load i64, ptr %10, align 8, !tbaa !9
  %46 = load i64, ptr %11, align 8, !tbaa !9
  %47 = mul i64 %45, %46
  %48 = mul i64 %47, 8
  %49 = call noalias ptr @malloc(i64 noundef %48) #8
  store ptr %49, ptr %16, align 8, !tbaa !5
  %50 = load ptr, ptr %16, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %44
  store i32 -2, ptr @lapack_state, align 8, !tbaa !13
  store i1 false, ptr %8, align 1
  store i32 1, ptr %17, align 4
  br label %176

53:                                               ; preds = %44
  %54 = load ptr, ptr %16, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load i64, ptr %10, align 8, !tbaa !9
  %57 = load i64, ptr %11, align 8, !tbaa !9
  %58 = load i32, ptr %15, align 4, !tbaa !11
  call void @convert_layout(ptr noundef %54, ptr noundef %55, i64 noundef %56, i64 noundef %57, i32 noundef %58, i32 noundef 102)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %59 = load i64, ptr %10, align 8, !tbaa !9
  %60 = trunc i64 %59 to i32
  store i32 %60, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %61 = load i64, ptr %11, align 8, !tbaa !9
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %63 = load i32, ptr %18, align 4, !tbaa !11
  store i32 %63, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = load ptr, ptr %14, align 8, !tbaa !5
  call void @cgetrf_(ptr noundef %18, ptr noundef %19, ptr noundef %64, ptr noundef %20, ptr noundef %65, ptr noundef %21)
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load i64, ptr %10, align 8, !tbaa !9
  %68 = load i64, ptr %11, align 8, !tbaa !9
  %69 = mul i64 %67, %68
  %70 = mul i64 %69, 8
  call void @llvm.memset.p0.i64(ptr align 4 %66, i8 0, i64 %70, i1 false)
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load i64, ptr %10, align 8, !tbaa !9
  %73 = load i64, ptr %11, align 8, !tbaa !9
  %74 = mul i64 %72, %73
  %75 = mul i64 %74, 8
  call void @llvm.memset.p0.i64(ptr align 4 %71, i8 0, i64 %75, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %76

76:                                               ; preds = %162, %53
  %77 = load i64, ptr %22, align 8, !tbaa !9
  %78 = load i64, ptr %10, align 8, !tbaa !9
  %79 = icmp ult i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %165

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

82:                                               ; preds = %158, %81
  %83 = load i64, ptr %23, align 8, !tbaa !9
  %84 = load i64, ptr %11, align 8, !tbaa !9
  %85 = icmp ult i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %161

87:                                               ; preds = %82
  %88 = load i64, ptr %22, align 8, !tbaa !9
  %89 = load i64, ptr %23, align 8, !tbaa !9
  %90 = icmp ugt i64 %88, %89
  br i1 %90, label %91, label %106

91:                                               ; preds = %87
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = load i64, ptr %22, align 8, !tbaa !9
  %94 = load i64, ptr %11, align 8, !tbaa !9
  %95 = mul i64 %93, %94
  %96 = load i64, ptr %23, align 8, !tbaa !9
  %97 = add i64 %95, %96
  %98 = getelementptr inbounds %struct.ComplexFloat, ptr %92, i64 %97
  %99 = load ptr, ptr %16, align 8, !tbaa !5
  %100 = load i64, ptr %22, align 8, !tbaa !9
  %101 = load i64, ptr %11, align 8, !tbaa !9
  %102 = mul i64 %100, %101
  %103 = load i64, ptr %23, align 8, !tbaa !9
  %104 = add i64 %102, %103
  %105 = getelementptr inbounds %struct.ComplexFloat, ptr %99, i64 %104
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %98, ptr align 4 %105, i64 8, i1 false), !tbaa.struct !16
  br label %157

106:                                              ; preds = %87
  %107 = load i64, ptr %22, align 8, !tbaa !9
  %108 = load i64, ptr %23, align 8, !tbaa !9
  %109 = icmp eq i64 %107, %108
  br i1 %109, label %110, label %141

110:                                              ; preds = %106
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = load i64, ptr %22, align 8, !tbaa !9
  %113 = load i64, ptr %11, align 8, !tbaa !9
  %114 = mul i64 %112, %113
  %115 = load i64, ptr %23, align 8, !tbaa !9
  %116 = add i64 %114, %115
  %117 = getelementptr inbounds %struct.ComplexFloat, ptr %111, i64 %116
  %118 = getelementptr inbounds %struct.ComplexFloat, ptr %117, i32 0, i32 0
  store float 1.000000e+00, ptr %118, align 4, !tbaa !19
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = load i64, ptr %22, align 8, !tbaa !9
  %121 = load i64, ptr %11, align 8, !tbaa !9
  %122 = mul i64 %120, %121
  %123 = load i64, ptr %23, align 8, !tbaa !9
  %124 = add i64 %122, %123
  %125 = getelementptr inbounds %struct.ComplexFloat, ptr %119, i64 %124
  %126 = getelementptr inbounds %struct.ComplexFloat, ptr %125, i32 0, i32 1
  store float 0.000000e+00, ptr %126, align 4, !tbaa !21
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = load i64, ptr %22, align 8, !tbaa !9
  %129 = load i64, ptr %11, align 8, !tbaa !9
  %130 = mul i64 %128, %129
  %131 = load i64, ptr %23, align 8, !tbaa !9
  %132 = add i64 %130, %131
  %133 = getelementptr inbounds %struct.ComplexFloat, ptr %127, i64 %132
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = load i64, ptr %22, align 8, !tbaa !9
  %136 = load i64, ptr %11, align 8, !tbaa !9
  %137 = mul i64 %135, %136
  %138 = load i64, ptr %23, align 8, !tbaa !9
  %139 = add i64 %137, %138
  %140 = getelementptr inbounds %struct.ComplexFloat, ptr %134, i64 %139
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %133, ptr align 4 %140, i64 8, i1 false), !tbaa.struct !16
  br label %156

141:                                              ; preds = %106
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = load i64, ptr %22, align 8, !tbaa !9
  %144 = load i64, ptr %11, align 8, !tbaa !9
  %145 = mul i64 %143, %144
  %146 = load i64, ptr %23, align 8, !tbaa !9
  %147 = add i64 %145, %146
  %148 = getelementptr inbounds %struct.ComplexFloat, ptr %142, i64 %147
  %149 = load ptr, ptr %16, align 8, !tbaa !5
  %150 = load i64, ptr %22, align 8, !tbaa !9
  %151 = load i64, ptr %11, align 8, !tbaa !9
  %152 = mul i64 %150, %151
  %153 = load i64, ptr %23, align 8, !tbaa !9
  %154 = add i64 %152, %153
  %155 = getelementptr inbounds %struct.ComplexFloat, ptr %149, i64 %154
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %148, ptr align 4 %155, i64 8, i1 false), !tbaa.struct !16
  br label %156

156:                                              ; preds = %141, %110
  br label %157

157:                                              ; preds = %156, %91
  br label %158

158:                                              ; preds = %157
  %159 = load i64, ptr %23, align 8, !tbaa !9
  %160 = add i64 %159, 1
  store i64 %160, ptr %23, align 8, !tbaa !9
  br label %82, !llvm.loop !22

161:                                              ; preds = %86
  br label %162

162:                                              ; preds = %161
  %163 = load i64, ptr %22, align 8, !tbaa !9
  %164 = add i64 %163, 1
  store i64 %164, ptr %22, align 8, !tbaa !9
  br label %76, !llvm.loop !24

165:                                              ; preds = %80
  %166 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %166) #7
  %167 = load i32, ptr %21, align 4, !tbaa !11
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %174

169:                                              ; preds = %165
  %170 = load i32, ptr %21, align 4, !tbaa !11
  %171 = icmp sgt i32 %170, 0
  %172 = zext i1 %171 to i64
  %173 = select i1 %171, i32 -3, i32 -1
  store i32 %173, ptr @lapack_state, align 8, !tbaa !13
  store i1 false, ptr %8, align 1
  store i32 1, ptr %17, align 4
  br label %175

174:                                              ; preds = %165
  store i32 0, ptr @lapack_state, align 8, !tbaa !13
  store i1 true, ptr %8, align 1
  store i32 1, ptr %17, align 4
  br label %175

175:                                              ; preds = %174, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %176

176:                                              ; preds = %175, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %177

177:                                              ; preds = %176, %43
  %178 = load i1, ptr %8, align 1
  ret i1 %178
}

declare void @cgetrf_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #6

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 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }
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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"", !12, i64 0, !15, i64 4, !10, i64 8, !6, i64 16}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !17}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!20, !18, i64 0}
!20 = !{!"", !18, i64 0, !18, i64 4}
!21 = !{!20, !18, i64 4}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.anon = type { i32, i8, i64, ptr }
%struct.ComplexFloat = type { float, float }

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @initialize_lapack() local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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
declare hidden void @convert_layout(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @lapack_lu(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef writeonly %3, ptr noundef writeonly %4, ptr noundef %5, i32 noundef %6) local_unnamed_addr #0 {
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = tail call zeroext i1 @initialize_lapack()
  %13 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %14 = insertelement <4 x ptr> %13, ptr %3, i64 1
  %15 = insertelement <4 x ptr> %14, ptr %4, i64 2
  %16 = insertelement <4 x ptr> %15, ptr %5, i64 3
  %17 = icmp eq <4 x ptr> %16, zeroinitializer
  %18 = bitcast <4 x i1> %17 to i4
  %19 = icmp eq i4 %18, 0
  %op.rdx = and i1 %19, %12
  %or.cond7.not = xor i1 %op.rdx, true
  %20 = icmp eq i64 %1, 0
  %or.cond9 = or i1 %20, %or.cond7.not
  %21 = icmp eq i64 %2, 0
  %or.cond11 = or i1 %21, %or.cond9
  br i1 %or.cond11, label %22, label %23

22:                                               ; preds = %7
  store i32 -1, ptr @lapack_state, align 8, !tbaa !5
  br label %55

23:                                               ; preds = %7
  %24 = shl i64 %1, 3
  %25 = mul i64 %24, %2
  %26 = tail call noalias ptr @malloc(i64 noundef %25) #6
  %.not = icmp eq ptr %26, null
  br i1 %.not, label %27, label %.preheader.us.preheader

27:                                               ; preds = %23
  store i32 -2, ptr @lapack_state, align 8, !tbaa !5
  br label %55

.preheader.us.preheader:                          ; preds = %23
  tail call void @convert_layout(ptr noundef nonnull %26, ptr noundef %0, i64 noundef %1, i64 noundef %2, i32 noundef %6, i32 noundef 102)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %28 = trunc i64 %1 to i32
  store i32 %28, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %29 = trunc i64 %2 to i32
  store i32 %29, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  store i32 %28, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  call void @cgetrf_(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %26, ptr noundef nonnull %10, ptr noundef nonnull %5, ptr noundef nonnull %11) #7
  call void @llvm.memset.p0.i64(ptr align 4 %3, i8 0, i64 %25, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %4, i8 0, i64 %25, i1 false)
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %.07886.us = phi i64 [ %51, %._crit_edge.us ], [ 0, %.preheader.us.preheader ]
  %30 = mul i64 %.07886.us, %2
  %31 = add i64 %.07886.us, %30
  %32 = getelementptr inbounds %struct.ComplexFloat, ptr %3, i64 %31
  %33 = getelementptr inbounds %struct.ComplexFloat, ptr %4, i64 %31
  %34 = getelementptr inbounds %struct.ComplexFloat, ptr %26, i64 %31
  br label %35

35:                                               ; preds = %.preheader.us, %48
  %.085.us = phi i64 [ 0, %.preheader.us ], [ %50, %48 ]
  %36 = icmp ugt i64 %.07886.us, %.085.us
  br i1 %36, label %44, label %37

37:                                               ; preds = %35
  %38 = icmp eq i64 %.07886.us, %.085.us
  br i1 %38, label %43, label %39

39:                                               ; preds = %37
  %40 = add i64 %.085.us, %30
  %41 = getelementptr inbounds %struct.ComplexFloat, ptr %4, i64 %40
  %42 = getelementptr inbounds %struct.ComplexFloat, ptr %26, i64 %40
  br label %48

43:                                               ; preds = %37
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %32, align 4, !tbaa !14
  br label %48

44:                                               ; preds = %35
  %45 = add i64 %.085.us, %30
  %46 = getelementptr inbounds %struct.ComplexFloat, ptr %3, i64 %45
  %47 = getelementptr inbounds %struct.ComplexFloat, ptr %26, i64 %45
  br label %48

48:                                               ; preds = %44, %43, %39
  %.sink93 = phi ptr [ %47, %44 ], [ %34, %43 ], [ %42, %39 ]
  %.sink92 = phi ptr [ %46, %44 ], [ %33, %43 ], [ %41, %39 ]
  %49 = load i64, ptr %.sink93, align 4
  store i64 %49, ptr %.sink92, align 4
  %50 = add nuw i64 %.085.us, 1
  %exitcond.not = icmp eq i64 %50, %2
  br i1 %exitcond.not, label %._crit_edge.us, label %35, !llvm.loop !16

._crit_edge.us:                                   ; preds = %48
  %51 = add nuw i64 %.07886.us, 1
  %exitcond91.not = icmp eq i64 %51, %1
  br i1 %exitcond91.not, label %._crit_edge87, label %.preheader.us, !llvm.loop !18

._crit_edge87:                                    ; preds = %._crit_edge.us
  call void @free(ptr noundef nonnull %26) #7
  %52 = load i32, ptr %11, align 4, !tbaa !13
  %.not84 = icmp eq i32 %52, 0
  %53 = icmp sgt i32 %52, 0
  %54 = select i1 %53, i32 -3, i32 -1
  %storemerge = select i1 %.not84, i32 0, i32 %54
  store i32 %storemerge, ptr @lapack_state, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %55

55:                                               ; preds = %27, %._crit_edge87, %22
  %.2 = phi i1 [ false, %22 ], [ %.not84, %._crit_edge87 ], [ false, %27 ]
  ret i1 %.2
}

declare void @cgetrf_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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


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